Webhooks
Information about how to use webhooks.
Webhooks lets you receive notifications from us when your registered tasks are done being processed. It saves you from polling status endpoints, which saves resources.
Creating a webhook
Testing webhooks
Quick test
The first thing you would probably like to test after creating a webhook, is to see if it indeed notifies your endpoint. You can quickly check this by clicking the "Arrow" button to send a test webhook. Your endpoint should get a request containing the following body:
{
"event": "test-webhook-from-sportai-console",
"payload": { "task_id": "123" }
}Proper test
To test webhook properly, you can register a task with our API. When the task is finished, we will call your endpoint with one of the following request bodies.
For successful analyses:
{
"event": "completed",
"payload": { "task_id": "6a344ba1-d2ff-4e41-9a41-3d67775801b4" }
}For analyses that were not successful:
{
"event": "failed",
"payload": { "task_id": "6a344ba1-d2ff-4e41-9a41-3d67775801b4" }
}Either result means that we are done processing your task, and you can retrieve the result by calling the task's corresponding result endpoint with the value of task_id, e.g., for statistics.
Updating a webhook's endpoint URL
You can update a webhook's endpoint URL by clicking on the corresponding "note button".
Deleting webhooks
You can delete a webhook by clicking on the corresponding "trashcan button".