Webhooks

Let Instruqt automatically send track data to your system.

This reference explains:

  • What webhooks are

  • The benefit of webhooks

  • The different use cases for webhooks

  • How to configure webhooks

  • Which webhook events you can consume

Overview

You can think of a webhook as a type of Application Programming Interface (API) driven by events rather than requests. So, a webhook allows one system to send data to another when a particular event occurs. Unlike APIs, where one system requests another to receive data.

Examples of webhook events are:

  • A track is started

  • A challenge is started

  • A track is completed

With APIs, you frequently need to send requests to check if data is updated or if new data is available. With webhooks, you receive updated or new data automatically. And only when they occur. Therefore, webhooks are more efficient than APIs.

Instruqt and webhooks

Instruqt facilitates webhooks, which allows you to integrate your system with Instruqt. For example, Instruqt can send event data to your system when events occur like:

  • Sandbox created

  • Track started

  • Challenge started

And the sent event data can contain fields like:

  • track_slug

  • timestamp

  • participant_id

Use cases

Common use cases for applying Instruqt webhooks are:

  • LMS integration By processing Instruqt event data in your LMS, you can track your learners' progress in achieving their learning goals.

  • CRM integration By processing Instruqt event data in your CRM, you can track your potential customers' progress in experimenting with your software.

Configure webhooks

You configure a webhook by setting an endpoint for the webhook. An endpoint is a URL at your end where Instruqt delivers event data.

Add an endpoint

  1. Click Settings Webhooks.

  2. Click + Add Endpoint and enter the URL which exposes your webhook.

  3. Select the events you want to send to this webhook. Leave empty if you want to send all events to the webhook.

  4. Click Create to add the endpoint.

Endpoint URLs must be publically accessible.

You can view all events delivered, either successfully or failed, to your configured endpoints on the Logs tab. The Activity tab shows a chart with the recent delivery attempts.

Edit an endpoint

  1. Click SettingsWebhooks.

  2. Click the URL of the endpoint you want to edit.

  3. Click Edit behind one of these items:

    • the URL

    • the Description

    • the text Subscribed events

  4. Enter your change.

  5. Click Save to store your change.

Test an endpoint

  1. Click SettingsWebhooks.

  2. Click the URL of the endpoint you want to test.

  3. Click the Testing tab.

  4. Select the Send event of your liking.

  5. Click Send example.

Delete an endpoint

  1. Click SettingsWebhooks.

  2. Click the URL of the endpoint you want to delete.

  3. Click the three-dots in the upper right to open the pop-up menu.

  4. Click Delete in the pop-up menu.

  5. Click Delete in the pop-up confirmation.

Verifying authenticity

Because your webhook endpoint is publicly available, anyone can impersonate the Instruqt platform by sending events to your endpoint.

Instruqt signs every webhook and metadata with a unique key for each endpoint to identify impersonated requests. You can use this signature to verify the event's authenticity.

See the Svix documentation for how to verify the event's signature.

Events and payload

The data sent about an event is known as the payload. Instruqt payloads are in JSON format. For example, the challenge_attempt event delivers a payload like this:

{
  "challenge_id": "dxhrbpuvvia9",
  "completed": true,
  "invite_id": null,
  "organization_id": "instruqt",
  "participant_id": "tncb0s7cdkyu",
  "timestamp": "2021-07-29T16:14:57.31297754Z",
  "track_id": "rzwlxtp92ted",
  "track_slug": "getting-started-with-instruqt",
  "type": "track.challenge_attempted",
  "user_id": "gOGhYjyoPJhINJFOugIgiL4pdzu2"
}

Events

Instruqt events are grouped at the following levels:

  • Track

  • Sandbox

  • Review

The following tables show the events per group and the corresponding fields in the payload.

Track events:

Track payload fields:

Additionally, challenge events can contain the following payload fields:

Sandbox events:

Sandbox payload fields:

Invite events:

Invite payload fields:

Review events:

Review payload fields:

Advanced: Enriching events

Webhook events do not contain data that personally identifies learners. If your webhook integration requires personally identifiable information (PII) data, it is possible to enrich events by calling the Instruqt GraphQL API with the Invite ID.

The following query shows how to fetch the details collected for all claims on a given invite.

query {
    trackInvite(inviteID: "invite-id") {
        claims {
            userDetails {
	        firstName
		lastName
		email
            }
        }
    }
}

Example: Sending events to Zapier

Zapier is a no-code automation platform that can intermediate through webhooks between Instruqt and your system. In a Zapier setup, Instruqt sends the webhook payload to Zapier, and Zapier passes the payload through to your system.

Follow these steps to create a Zap for an Instruqt webhook:

  1. Create a new Zap.

  2. Configure the Webhooks by Zapier trigger.

  3. Select the Catch Hook trigger.

  4. Copy the Custom Webhook URL that Zapier created for the Catch Hook trigger.

  5. Go to Instruqt and add an endpoint with the copied URL.

  6. Start a track in Instruqt.

  7. Go back to Zapier and click Test trigger to check if Zapier found a request. Zapier should show an Instruqt payload.

  8. Configure any Action in Zapier to pass through the Instruqt payload to your system.

Last updated