ส่ง Test Event ประเภท ping ไปยัง endpoint_url ของ Webhook Subscription เพื่อทดสอบว่า Endpoint รับ Request ได้จริง
Response จะบอกว่า Endpoint ของคุณตอบกลับอะไร — ทำให้ Debug ได้โดยไม่ต้องรอ Event จริงเกิดขึ้น
Endpoint นี้เหมาะสำหรับ:
read:webhooks
POST /api/partner/v1/webhooks/:id/ping
Authorization: Bearer <access_token>
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string (UUID) | Yes | Webhook Subscription ID |
Request Body: ไม่ต้องส่ง
curl -X POST \
"https://<host>/api/partner/v1/webhooks/a1b2c3d4-0000-0000-0000-000000000001/ping" \
-H "Authorization: Bearer <access_token>"
200 OK
{
"data": {
"webhook_id": "a1b2c3d4-0000-0000-0000-000000000001",
"delivered": true,
"response_status": 200,
"response_body": "ok"
}
}
| Field | Type | Description |
|---|---|---|
| webhook_id | string (UUID) | Webhook Subscription ID |
| delivered | boolean | true หาก Endpoint ตอบกลับ 2xx |
| response_status | number | null | HTTP Status ที่ได้รับจาก Endpoint — null หากเกิด Network Error หรือ Timeout |
| response_body | string | null | ส่วนแรกของ Response Body ที่ได้รับจาก Endpoint |
Ping จะส่ง Payload โครงสร้างเดียวกับ Event จริง — Endpoint ต้องผ่าน Signature Verification เช่นกัน
delivered: false ไม่ได้หมายความว่า API ล้มเหลว — API ทำงานสำเร็จ แต่ Endpoint ของคุณตอบกลับ non-2xx หรือไม่ตอบสนอง ให้ตรวจสอบ response_status และ response_body เพื่อ Debug
400 Bad Request
{
"error": "invalid_request",
"message": "Webhook subscription is not active"
}
สาเหตุ:
PAUSED หรือ DISABLEDACTIVE ก่อนจึงจะ Ping ได้404 Not Found
{
"error": "not_found",
"message": "Webhook subscription not found"
}
สาเหตุ:
id ไม่ถูกต้อง