查看投遞紀錄
GET
/v1/webhook-endpoints/{id}/deliveries列出端點的投遞紀錄,依時間倒序、游標分頁;不含事件內容。
驗證
請求標頭需攜帶 Authorization: Bearer <API_KEY>。API Key 可存取的資源由目前授權範圍決定。
請求
Base URL:https://api.bluehola.com
參數
| 名稱 | 位置 | 必填 | 類型/約束 | 說明 |
|---|---|---|---|---|
id | path | 是 | string | 回呼端點 ID,whe_... |
status | query | 否 | pending / queued / delivered / failed | 只回傳該狀態的投遞。其他取值回傳 400,不會被忽略 |
limit | query | 否 | integer,1–100 | 每頁筆數,預設 50。超出範圍回傳 400 |
before | query | 否 | string | 上一頁回傳的 nextCursor |
curl "https://api.bluehola.com/v1/webhook-endpoints/whe_123/deliveries?status=failed&limit=20" \
-H "Authorization: Bearer <API_KEY>"
回應
| 狀態碼 | 說明 |
|---|---|
200 | OK |
4xx | 用戶端錯誤 |
200 回應 Schema
{
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"endpointId": {
"type": "string"
},
"eventId": {
"type": [
"string",
"null"
]
},
"eventType": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"pending",
"queued",
"delivered",
"failed"
]
},
"attempts": {
"type": "integer"
},
"responseStatus": {
"type": [
"integer",
"null"
]
},
"responseBodyPreview": {
"type": [
"string",
"null"
]
},
"lastError": {
"type": [
"string",
"null"
]
},
"nextRetryAt": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"redeliveredFrom": {
"type": [
"string",
"null"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"completedAt": {
"type": [
"string",
"null"
],
"format": "date-time"
}
}
}
},
"nextCursor": {
"type": [
"string",
"null"
]
}
}
}
通用錯誤信封及處理建議見錯誤碼。
回應欄位
| 欄位 | 含義 |
|---|---|
items[].id | 投遞 ID,wd_... |
items[].endpointId | 這次投遞送往的端點 |
items[].eventId | 平台事件的 evt_... ID;Meta 原始形狀的事件(message / status / change)為 null |
items[].eventType | 事件類型,與 X-Webhook-Event 取值相同 |
items[].status | pending / queued:尚未結束,包括正在等待下一次重試的投遞。delivered:端點回傳了 2xx。failed:最終失敗——不可重試的 4xx,或 8 次嘗試已用完 |
items[].attempts | 目前已嘗試的次數 |
items[].responseStatus | 最後一次嘗試時端點回傳的 HTTP 狀態碼;沒有收到回應時為 null |
items[].responseBodyPreview | 端點回應主體的截斷摘要 |
items[].lastError | 最近一次錯誤,例如逾時或連線失敗 |
items[].nextRetryAt | 下一次自動重試的時間;沒有排定時為 null |
items[].redeliveredFrom | 手動重投時為原投遞的 ID;否則為 null |
items[].createdAt / completedAt | 投遞的建立時間與結束時間(未結束時 completedAt 為 null) |
nextCursor | 作為 before 傳入以取得下一頁;為 null 表示沒有更多 |
補充說明
列表不含事件 payload。要取回某個事件的內容,請對那一筆投遞呼叫重投。
當列出端點顯示 lastDelivery 失敗時,就在這裡排查:用 status=failed 篩選,找出端點錯過的事件。客戶 Key 只能讀取其客戶主體名下端點的投遞紀錄。