Webhooks are a system of automated notifications indicating that an event has occurred in your account. Rather than requiring you to pull information via our APIs or to make API calls periodically to check status of various events, webhooks push information to your destination as and when the events occur.
After you've subscribed to the webhooks, you can let your app execute code immediately after specific events occur in your account at HackerEarth. For example, you can rely on webhooks to trigger an action in your app when a candidate begins or ends an assessment, or when a candidate report or an assessment config gets updated at HackerEarth.
By using webhooks, you would be making fewer API calls overall, which makes sure that your apps are more efficient and update quickly.
Only a single endpoint can be configured per company account and that endpoint would be receiving webhooks for all types of events. You can get this endpoint configured by reaching out to api@hackerearth.com.
To correctly handle events delivered to your webhooks endpoint, please take care of the following points when designing your application:
An incoming webhooks message contains the following information:
Sample Webhook request body
{
"webhook_event_id": "49f6b922b2feee3be3ec79e88d6ff36",
"webhook_event_type": "CANDIDATE_TEST_STARTED",
"webhook_attempt_number": 1,
"webhook_payload":{
"test_id": 1035542,
"email": "alice@bob.com",
"start_datetime": "2019-08-05T10:11:46-05:51"
}
}
Type: String
Description: webhook_event_id would be a universally unique identifier (UUID) for the webhook event.
Type: String
Description: webhook_event_type would be an enum indicating the type of webhook event.
Type: Integer
Description: webhook_attempt_number would be the attempt count of a webhook request. It's value would be 1 for the initial request and would get incremented in case of retries.
Type: Dictionary (JSON)
Description: webhook_payload would contain the details corresponding to the webhook event.