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
Click Settings → Webhooks.
Click + Add Endpoint and enter the URL which exposes your webhook.
Select the events you want to send to this webhook. Leave empty if you want to send all events to the webhook.
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
Click Settings → Webhooks.
Click the URL of the endpoint you want to edit.
Click Edit behind one of these items:
the URL
the Description
the text Subscribed events
Enter your change.
Click Save to store your change.
Test an endpoint
Click Settings → Webhooks.
Click the URL of the endpoint you want to test.
Click the Testing tab.
Select the Send event of your liking.
Click Send example.
Delete an endpoint
Click Settings → Webhooks.
Click the URL of the endpoint you want to delete.
Click the three-dots in the upper right to open the pop-up menu.
Click Delete in the pop-up menu.
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:
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:
Event | Description |
---|---|
| A user starts playing a track |
| A user completes a track |
| The platform cleaned the sandbox |
| A user submits a challenge attempt |
| The platform initialized a challenge by executing the setup script |
| The user completed the challenge |
| A user starts a challenge |
| The platform cleaned a challenge by executing the cleanup script |
| A user skipped to a challenge |
| A user or the platform stopped a track |
Track payload fields:
Key | Value | Type |
---|---|---|
| The track identifier |
|
| The track URL identifier. |
|
| The identifier of the organization this track belongs to |
|
| Instant the event occurred |
|
| The identifier of this user's unique play of the track |
|
| The invite the user claimed to gain access to this track, if any |
|
| The user identifier |
|
| The current play mode |
|
| The custom parameters for this play |
|
Additionally, challenge events can contain the following payload fields:
Key | Value |
---|---|
| The ID of the current challenge. |
| The index of the current challenge. |
| The total number of challenges for a track. |
Sandbox events:
Event | Description |
---|---|
| The platform starts creating a sandbox |
| The platform created a sandbox |
| The platform was unable to setup the sandbox |
| The platform cleaned the sandbox |
Sandbox payload fields:
Key | Value |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Invite events:
Event type | Description |
---|---|
| A user claimed an invite |
Invite payload fields:
Key | Value | Type |
---|---|---|
| The identifier of the invite |
|
| When it occurred |
|
| The identifier of the user claiming the invite |
|
| The identifier of the team this invite belongs to |
|
| The url identifier of the team this invite belongs to |
|
| The custom parameters for this invite |
|
Review events:
Event type | Description |
---|---|
| A user created a track review |
| A user updated a track review |
Review payload fields:
Key | Value | Type |
---|---|---|
| The identifier of this review |
|
| The identifier of the reviewed track |
|
| The identifier of the organization this track belongs to |
|
| The identifier of the user leaving a review |
|
| The score |
|
| The written feedback, if any |
|
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:
Create a new Zap.
Configure the Webhooks by Zapier trigger.
Select the Catch Hook trigger.
Copy the Custom Webhook URL that Zapier created for the Catch Hook trigger.
Go to Instruqt and add an endpoint with the copied URL.
Start a track in Instruqt.
Go back to Zapier and click Test trigger to check if Zapier found a request. Zapier should show an Instruqt payload.
Configure any Action in Zapier to pass through the Instruqt payload to your system.
Last updated