Webhooks
The webhooks API allows different systems to notify V3 of an event that has happened on that platform.
POST/v2/webhooks
Receive Webhook
This endpoint receives a webhook from another platform. The request must be authenticated with a valid OAuth access token.
Events which are received by V3, but don't have a corresponding listener are silently ignored, and a 200 response is returned
Payload
- Name
event
- Required
- required
- Type
- string
- Description
The name of the event. This must be one of the predefined events that V3 listens for.
- Name
payload
- Required
- required
- Type
- object
- Description
The payload associated with this event. This differs per event type.
Error Codes
Status | Description |
---|---|
422 | The data provided in the payload was invalid. See errors for more details. |
500 | There was an error trying to process the webhook. |
Request
POST
/v2/webhooksuse Compliance\Sdk\ApexV3\Contracts\ApexV3SdkInterface;
use Compliance\Sdk\Authentication\Types\Machine;
private ApexV3SdkInterface $sdk;
$response = $this->sdk
->v2(new Machine())
->webhooks()
->send('example.event.name', [
'id' => 1,
]);
Accepted Events
You can find a list of accepted events below, along with expected payloads.
Learning Attempt Completed
- Name
user_id
- Required
- required
- Type
- integer
- Description
ID of the user who completed the attempt
- Name
module_id
- Required
- required
- Type
- integer
- Description
ID of the module which had the attempt completed
- Name
attempt_id
- Required
- required
- Type
- integer
- Description
ID of the attempt record created
Request
{
"event": "learning.attempt.completed",
"payload": {
"user_id": 123,
"module_id": 456,
"attempt_id": 789
}
}