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:
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:
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