الويب هوك
نقاط استقبال الأحداث الموقّعة: التنبيهات والرحلات والمناطق والمهام، مع سجل التسليم وإعادة الإرسال.
عنوان الأساسhttps://api.ping.nml.sa/v110 عمليات
الانتقال إلى عملية
الأخطاء المشتركة
تُرجع عمليات هذه الصفحة هذه الأخطاء بصيغة واحدة، وتذكر كل عملية الأخطاء التي تُرجعها.
400The request is invalid (code: invalid_request), with field errors.401The API key is missing, unknown, expired or revoked (code: unauthorized).403The API key lacks the scope this operation needs (code: forbidden).404No such resource in this account, or outside the key's data scope (code: not_found).409The resource is not in a state that allows this (code: conflict), or the idempotency key is in use.429The key's rate limit is reached (code: rate_limited). Retry after the Retry-After header's seconds.
سجل تسليم الويب هوك.
GET/v1/webhook-deliveries
Deliveries are kept 30 days.
النطاقwebhooks:read
المعاملات
endpoint_idstringالاستعلامOne endpoint's deliveries.
مثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8cstatestringالاستعلامOnly deliveries in this state.
مثال:
succeededtypestringالاستعلامOnly deliveries of this event type.
مثال:
trip.endedlimitintegerالاستعلامItems per page, 1 to 200 (default 50).
cursorstringالاستعلامThe next_cursor of the previous page.
الاستجابة 200
dataobject[]حقول data
idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8cendpoint_idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8cevent_idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8ctypestringA delivered event's type: a WebhookEventType, or webhook.test.
أحد:
alarm.openedalarm.clearedtrip.endedgeofence.enteredgeofence.exitedjob.dispatchedjob.startedjob.completedjob.cancelledwebhook.testredelivery_ofstring | nullThe delivery this one sends again.
statestringأحد:
pendingsucceededfailedfailurestring | nullWhy it failed: every attempt failed, or the endpoint was disabled first.
أحد:
exhaustedendpoint_disablednullattemptsintegernext_attempt_atstring | null (date-time)When it is tried next (pending only).
created_atstring (date-time)done_atstring | null (date-time)
next_cursorstring | null
الأخطاء
curl "https://api.ping.nml.sa/v1/webhook-deliveries" \
-H "Authorization: Bearer $PING_API_KEY"{
"data": [
{
"id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"endpoint_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"event_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"type": "trip.ended",
"redelivery_of": "string",
"state": "succeeded",
"failure": "exhausted",
"attempts": 0,
"next_attempt_at": "string",
"created_at": "string",
"done_at": "string"
}
],
"next_cursor": "string"
}تسليم ويب هوك مع محاولاته.
GET/v1/webhook-deliveries/{deliveryId}
النطاقwebhooks:read
المعاملات
deliveryIdstringالمسار مطلوبمثال:
019ac0d2-3c4d-7e5f-8a6b-7c8d9e0f1a2b
الاستجابة 200
deliveryobjectحقول delivery
idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8cendpoint_idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8cevent_idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8ctypestringA delivered event's type: a WebhookEventType, or webhook.test.
أحد:
alarm.openedalarm.clearedtrip.endedgeofence.enteredgeofence.exitedjob.dispatchedjob.startedjob.completedjob.cancelledwebhook.testredelivery_ofstring | nullThe delivery this one sends again.
statestringأحد:
pendingsucceededfailedfailurestring | nullWhy it failed: every attempt failed, or the endpoint was disabled first.
أحد:
exhaustedendpoint_disablednullattemptsintegernext_attempt_atstring | null (date-time)When it is tried next (pending only).
created_atstring (date-time)done_atstring | null (date-time)
payloadalarm.opened | alarm.cleared | trip.ended | geofence.entered | geofence.exited | job.dispatched | job.started | job.completed | job.cancelled | webhook.testOne webhook body: the payload of its type.
attempt_logobject[]Every attempt, first first.
حقول attempt_log
nintegeratstring (date-time)urlstringThe URL it went to (the endpoint's at the time).
addressstring | nullThe address dialled.
مثال:
203.0.113.7outcomestringdelivered: 2xx; http_error: another status (redirects are not followed); unreachable: DNS, connection or TLS; refused_address: the host resolved to a non-public address.
أحد:
deliveredhttp_errortimeoutunreachablerefused_addressstatusinteger | nullduration_msintegererrorstring | nullWhat went wrong, for people.
الأخطاء
curl "https://api.ping.nml.sa/v1/webhook-deliveries/019ac0d2-3c4d-7e5f-8a6b-7c8d9e0f1a2b" \
-H "Authorization: Bearer $PING_API_KEY"{
"delivery": {
"id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"endpoint_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"event_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"type": "trip.ended",
"redelivery_of": "string",
"state": "succeeded",
"failure": "exhausted",
"attempts": 0,
"next_attempt_at": "string",
"created_at": "string",
"done_at": "string"
},
"payload": {
"id": "019ac0d1-7a2b-7c3d-8e4f-5a6b7c8d9e0f",
"type": "alarm.opened",
"occurred_at": "2026-11-17T08:30:00Z",
"data": {
"alarm_id": "019ac0c6-2c3d-7e4f-8a5b-6c7d8e9f0a1b",
"rule_id": "string",
"vehicle_id": "string",
"kind": "overspeed",
"severity": "info",
"opened_at": "string",
"lat": 24.7136,
"lon": 46.6753
}
},
"attempt_log": [
{
"n": 0,
"at": "string",
"url": "string",
"address": "203.0.113.7",
"outcome": "delivered",
"status": 0,
"duration_ms": 0,
"error": "string"
}
]
}إعادة إرسال حدث ويب هوك.
POST/v1/webhook-deliveries/{deliveryId}/redeliver
Only a delivery that succeeded or failed, to an enabled endpoint (else 409).
النطاقwebhooks:write
المعاملات
deliveryIdstringالمسار مطلوبمثال:
019ac0d2-3c4d-7e5f-8a6b-7c8d9e0f1a2b
الاستجابة 202
idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8cendpoint_idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8cevent_idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8ctypestringA delivered event's type: a WebhookEventType, or webhook.test.
أحد:
alarm.openedalarm.clearedtrip.endedgeofence.enteredgeofence.exitedjob.dispatchedjob.startedjob.completedjob.cancelledwebhook.testredelivery_ofstring | nullThe delivery this one sends again.
statestringأحد:
pendingsucceededfailedfailurestring | nullWhy it failed: every attempt failed, or the endpoint was disabled first.
أحد:
exhaustedendpoint_disablednullattemptsintegernext_attempt_atstring | null (date-time)When it is tried next (pending only).
created_atstring (date-time)done_atstring | null (date-time)
الأخطاء
curl -X POST "https://api.ping.nml.sa/v1/webhook-deliveries/019ac0d2-3c4d-7e5f-8a6b-7c8d9e0f1a2b/redeliver" \
-H "Authorization: Bearer $PING_API_KEY"{
"id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"endpoint_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"event_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"type": "trip.ended",
"redelivery_of": "string",
"state": "succeeded",
"failure": "exhausted",
"attempts": 0,
"next_attempt_at": "string",
"created_at": "string",
"done_at": "string"
}قائمة نقاط استقبال الويب هوك.
GET/v1/webhook-endpoints
النطاقwebhooks:read
المعاملات
limitintegerالاستعلامItems per page, 1 to 200 (default 50).
cursorstringالاستعلامThe next_cursor of the previous page.
الاستجابة 200
dataobject[]حقول data
idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8curlstringمثال:
https://erp.example.com/ping/webhooksdescriptionstring | nullمثال:
ERP alarms feedevent_typesstring[]enabledbooleandisabled_reasonstring | nullowner: turned off by a person; failing: disabled after repeated failure; account_ended: the account left PING (its exit).
أحد:
ownerfailingaccount_endednulldisabled_atstring | null (date-time)secret_hintstringThe secret's last four characters.
مثال:
x7Qasecret_rotated_atstring (date-time)consecutive_failuresintegerDeliveries in a row that failed for good.
created_atstring (date-time)updated_atstring (date-time)
next_cursorstring | null
الأخطاء
curl "https://api.ping.nml.sa/v1/webhook-endpoints" \
-H "Authorization: Bearer $PING_API_KEY"{
"data": [
{
"id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"url": "https://erp.example.com/ping/webhooks",
"description": "ERP alarms feed",
"event_types": [
"alarm.opened"
],
"enabled": false,
"disabled_reason": "owner",
"disabled_at": "string",
"secret_hint": "x7Qa",
"secret_rotated_at": "string",
"consecutive_failures": 0,
"created_at": "string",
"updated_at": "string"
}
],
"next_cursor": "string"
}إضافة نقطة استقبال ويب هوك؛ يظهر سر التوقيع مرة واحدة.
POST/v1/webhook-endpoints
The URL must be https and its host a name or a public address (private, loopback, link-local and reserved addresses are refused, and checked again on every delivery). At most 10 endpoints per account.
النطاقwebhooks:write يقبل Idempotency-Key
المعاملات
Idempotency-KeystringالترويسةA unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.
محتوى الطلب
urlstringمطلوبhttps only; no credentials, no private, loopback or link-local address.
مثال:
https://erp.example.com/ping/webhooksdescriptionstringمثال:
ERP alarms feedevent_typesstring[]مطلوبمثال:
["alarm.opened","alarm.cleared"]enabledboolean
الاستجابة 201
endpointobjectحقول endpoint
idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8curlstringمثال:
https://erp.example.com/ping/webhooksdescriptionstring | nullمثال:
ERP alarms feedevent_typesstring[]enabledbooleandisabled_reasonstring | nullowner: turned off by a person; failing: disabled after repeated failure; account_ended: the account left PING (its exit).
أحد:
ownerfailingaccount_endednulldisabled_atstring | null (date-time)secret_hintstringThe secret's last four characters.
مثال:
x7Qasecret_rotated_atstring (date-time)consecutive_failuresintegerDeliveries in a row that failed for good.
created_atstring (date-time)updated_atstring (date-time)
secretstringThe signing secret, shown only in this answer.
مثال:
whsec_4fJ9kQ2mX7pL1sV8nR3tY6wZ0aB5cD7x
الأخطاء
curl -X POST "https://api.ping.nml.sa/v1/webhook-endpoints" \
-H "Authorization: Bearer $PING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://erp.example.com/ping/webhooks", "description": "ERP alarms feed", "event_types": ["alarm.opened", "alarm.cleared"]}'{
"endpoint": {
"id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"url": "https://erp.example.com/ping/webhooks",
"description": "ERP alarms feed",
"event_types": [
"alarm.opened"
],
"enabled": false,
"disabled_reason": "owner",
"disabled_at": "string",
"secret_hint": "x7Qa",
"secret_rotated_at": "string",
"consecutive_failures": 0,
"created_at": "string",
"updated_at": "string"
},
"secret": "whsec_4fJ9kQ2mX7pL1sV8nR3tY6wZ0aB5cD7x"
}نقطة استقبال ويب هوك.
GET/v1/webhook-endpoints/{endpointId}
النطاقwebhooks:read
المعاملات
endpointIdstringالمسار مطلوبمثال:
019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f
الاستجابة 200
idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8curlstringمثال:
https://erp.example.com/ping/webhooksdescriptionstring | nullمثال:
ERP alarms feedevent_typesstring[]enabledbooleandisabled_reasonstring | nullowner: turned off by a person; failing: disabled after repeated failure; account_ended: the account left PING (its exit).
أحد:
ownerfailingaccount_endednulldisabled_atstring | null (date-time)secret_hintstringThe secret's last four characters.
مثال:
x7Qasecret_rotated_atstring (date-time)consecutive_failuresintegerDeliveries in a row that failed for good.
created_atstring (date-time)updated_atstring (date-time)
الأخطاء
curl "https://api.ping.nml.sa/v1/webhook-endpoints/019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f" \
-H "Authorization: Bearer $PING_API_KEY"{
"id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"url": "https://erp.example.com/ping/webhooks",
"description": "ERP alarms feed",
"event_types": [
"alarm.opened"
],
"enabled": false,
"disabled_reason": "owner",
"disabled_at": "string",
"secret_hint": "x7Qa",
"secret_rotated_at": "string",
"consecutive_failures": 0,
"created_at": "string",
"updated_at": "string"
}تعديل نقطة استقبال ويب هوك.
PATCH/v1/webhook-endpoints/{endpointId}
Fields given replace the stored ones; event_types replaces the list whole. enabled false stops deliveries (pending ones fail as endpoint_disabled); enabled true turns a disabled endpoint back on and clears its failure count.
النطاقwebhooks:write
المعاملات
endpointIdstringالمسار مطلوبمثال:
019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f
محتوى الطلب
urlstringمثال:
https://erp.example.com/ping/webhooksdescriptionstringAn empty description clears it.
event_typesstring[]enabledboolean
الاستجابة 200
idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8curlstringمثال:
https://erp.example.com/ping/webhooksdescriptionstring | nullمثال:
ERP alarms feedevent_typesstring[]enabledbooleandisabled_reasonstring | nullowner: turned off by a person; failing: disabled after repeated failure; account_ended: the account left PING (its exit).
أحد:
ownerfailingaccount_endednulldisabled_atstring | null (date-time)secret_hintstringThe secret's last four characters.
مثال:
x7Qasecret_rotated_atstring (date-time)consecutive_failuresintegerDeliveries in a row that failed for good.
created_atstring (date-time)updated_atstring (date-time)
الأخطاء
curl -X PATCH "https://api.ping.nml.sa/v1/webhook-endpoints/019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f" \
-H "Authorization: Bearer $PING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://erp.example.com/ping/webhooks"}'{
"id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"url": "https://erp.example.com/ping/webhooks",
"description": "ERP alarms feed",
"event_types": [
"alarm.opened"
],
"enabled": false,
"disabled_reason": "owner",
"disabled_at": "string",
"secret_hint": "x7Qa",
"secret_rotated_at": "string",
"consecutive_failures": 0,
"created_at": "string",
"updated_at": "string"
}حذف نقطة استقبال ويب هوك.
DELETE/v1/webhook-endpoints/{endpointId}
النطاقwebhooks:write
المعاملات
endpointIdstringالمسار مطلوبمثال:
019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f
الاستجابة 204
Removed.
الأخطاء
curl -X DELETE "https://api.ping.nml.sa/v1/webhook-endpoints/019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f" \
-H "Authorization: Bearer $PING_API_KEY"تجديد سر توقيع نقطة استقبال الويب هوك.
POST/v1/webhook-endpoints/{endpointId}/rotate-secret
النطاقwebhooks:write
المعاملات
endpointIdstringالمسار مطلوبمثال:
019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f
الاستجابة 200
endpointobjectحقول endpoint
idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8curlstringمثال:
https://erp.example.com/ping/webhooksdescriptionstring | nullمثال:
ERP alarms feedevent_typesstring[]enabledbooleandisabled_reasonstring | nullowner: turned off by a person; failing: disabled after repeated failure; account_ended: the account left PING (its exit).
أحد:
ownerfailingaccount_endednulldisabled_atstring | null (date-time)secret_hintstringThe secret's last four characters.
مثال:
x7Qasecret_rotated_atstring (date-time)consecutive_failuresintegerDeliveries in a row that failed for good.
created_atstring (date-time)updated_atstring (date-time)
secretstringThe signing secret, shown only in this answer.
مثال:
whsec_4fJ9kQ2mX7pL1sV8nR3tY6wZ0aB5cD7x
الأخطاء
curl -X POST "https://api.ping.nml.sa/v1/webhook-endpoints/019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f/rotate-secret" \
-H "Authorization: Bearer $PING_API_KEY"{
"endpoint": {
"id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"url": "https://erp.example.com/ping/webhooks",
"description": "ERP alarms feed",
"event_types": [
"alarm.opened"
],
"enabled": false,
"disabled_reason": "owner",
"disabled_at": "string",
"secret_hint": "x7Qa",
"secret_rotated_at": "string",
"consecutive_failures": 0,
"created_at": "string",
"updated_at": "string"
},
"secret": "whsec_4fJ9kQ2mX7pL1sV8nR3tY6wZ0aB5cD7x"
}إرسال حدث تجريبي إلى نقطة استقبال الويب هوك.
POST/v1/webhook-endpoints/{endpointId}/test
النطاقwebhooks:write
المعاملات
endpointIdstringالمسار مطلوبمثال:
019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f
الاستجابة 202
idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8cendpoint_idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8cevent_idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8ctypestringA delivered event's type: a WebhookEventType, or webhook.test.
أحد:
alarm.openedalarm.clearedtrip.endedgeofence.enteredgeofence.exitedjob.dispatchedjob.startedjob.completedjob.cancelledwebhook.testredelivery_ofstring | nullThe delivery this one sends again.
statestringأحد:
pendingsucceededfailedfailurestring | nullWhy it failed: every attempt failed, or the endpoint was disabled first.
أحد:
exhaustedendpoint_disablednullattemptsintegernext_attempt_atstring | null (date-time)When it is tried next (pending only).
created_atstring (date-time)done_atstring | null (date-time)
الأخطاء
curl -X POST "https://api.ping.nml.sa/v1/webhook-endpoints/019ac0d0-1a2b-7c3d-8e4f-5a6b7c8d9e0f/test" \
-H "Authorization: Bearer $PING_API_KEY"{
"id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"endpoint_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"event_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"type": "trip.ended",
"redelivery_of": "string",
"state": "succeeded",
"failure": "exhausted",
"attempts": 0,
"next_attempt_at": "string",
"created_at": "string",
"done_at": "string"
}