Webhook
When an asynchronous analysis is completed, a webhook is sent with the analysis result. To do so, it is necessary to configure an address where we will send the notifications and also a signature_key that will be used to sign the request. If you do not yet have a webhook configured, contact the support team.
Signature
To ensure that the request received at the webhook endpoint comes from our servers, an HMAC signature is sent along with the webhook. You can use this signature to verify that the webhook originated from our servers.
Signature calculation example in Python
hmac_obj = hmac.new(signature_key.encode('utf-8'), (endpoint + method + payload).encode('utf-8'), hashlib.sha1)
return hmac_obj.hexdigest()
Request
The request has the format below and notifies that the analysis has been completed. The request uses the HTTP POST method and the request body is sent as UTF-8 encoded text.
Success Webhook
curl --location 'YOUR-ENDPOINT-HERE' \
--header 'Signature: CALCULATED-HASH-HMAC' \
--data '{"id": "e314ffci-14f3-41a1-ad5d-c9c18782jhfe", "document": {"analysis_result": {...}, "validation_status": "valid"}, "status": "successful", "status_reason": "", "status_description": "Sucessfull Analysis"}'
Error Webhook
curl --location 'YOUR-ENDPOINT-HERE' \
--header 'Signature: CALCULATED-HASH-HMAC' \
--data '{"id": "e314ffci-14f3-41a1-ad5d-c9c18782jhfe", "status": "bad_request", "status_reason": "missing_information
", "status_description": "The document is missing required information."}'