Setup a callback to your server when a task finishes running
callback_url
argument to your function decorator, a POST request will be made to your server whenever a task finishes running. Callbacks fire for both successful and failed tasks.
Callbacks include the Task ID in the request headers, and the task response URL-encoded in the request body.
data
field:
x-task-timestamp
— timestamp the task was created.x-task-signature
— signature to verify that the request was sent from beta9.x-task-status
— status of the task.x-task-id
— the task ID.x-task-signature
.
x-task-signature
is a unique signature generated by converting the request body to base64, concatenating it with the timestamp, and signing it with your API token.
The code below shows how to validate a callback signature: