Webhooks
You can establish a webhook that triggers whenever a content request is altered.
To set up your webhook, please get in touch with our support team and provide your
desired endpoints for both your production- and test environment. The webhook is initiated as a PUT
request sent to your specified
webhook endpoint and transmits a JSON body (see format below). It is invoked
both when a request is initially created and when its state is modified.
For test requests, the state will transition to completed
after approximately 10 seconds.
Callback format
The webhook format consists of a type
property, together with more specific properties based on
the kind of request it reports for.
When it comes to content requests, the format is structured as follows:
{
"type": "content-request",
"request": ...content-request...
}
Please exercise added caution when handling incoming callbacks and ensure that the type is indeed labeled
as content-request
. It's important to perform this check because, in the future, there might be additional
type values introduced for new API features.
Security
For authentication, the webhook service will echo back the token you provide in the authorization
header of your setup request.
This will be the test token
for test content requests and the prod token
for non-test content requests.
{
"headers": {
"authorization": "Bearer TEST_OR_PROD_TOKEN"
},
"body": ...callback format...
}
Please note, we only accept webhook endpoints that are secured via HTTPS. HTTP endpoints will not be accepted due to security concerns.
Failures, retries and guarantees
Please note that the order in which state changes are received by a webhook is not guaranteed. In cases where a webhook
call is delayed or fails, it's possible that a change to a confirmed
state may be received after a change to completed
.
To handle such situations, the request dates can provide valuable context, and any discrepancies or errors can be addressed
through your regular synchronization process.