API referenceResources
Register a webhook
Register a webhook URL for a service. Only one webhook can be registered per service: if a webhook for the service already exists (active or deleted), its target URL is replaced and the webhook becomes active. Use the flow-end service name to receive a notification when a flow ends, or a custom_<name> service name for custom notifications.
POST
/resources/webhookcurl -X POST "https://demo.verigram.kz/resources/webhook" \
-H "X-Verigram-Api-Key: $IDENTIFICATION_SAAS_API_KEY" \
-H "X-Verigram-Api-Version: 2.0.0" \
-H "Content-Type: application/json" \
-d '{
"target_url": "https://example.com/webhooks/verigram",
"service_name": "flow-end"
}'Авторизация
X-Verigram-Api-KeystringheaderобязательноAPI key in the X-Verigram-Api-Key header
Параметры
X-Verigram-Api-VersionstringheaderобязательноRequired API version header.
Значение по умолчанию:2.0.0
Тело
application/json
target_urlstring<uri>обязательноURL the notifications are sent to
service_nameany ofобязательноService the webhook is registered for. Either a service name,
flow-endto be notified when a flow ends, or a custom name in thecustom_<name>format.
Ответ
Webhook registered
{
"error_code": "NOT_FOUND, UNKNOWN_DOC_TYPE, UNAUTHORIZED, INVALID_PAYLOAD, DUPLICATE_KEY",
"error_msg": "Person ID is required"
}