跳到主要內容

查看投遞紀錄

GET/v1/webhook-endpoints/{id}/deliveries

列出端點的投遞紀錄,依時間倒序、游標分頁;不含事件內容。

驗證

請求標頭需攜帶 Authorization: Bearer <API_KEY>。API Key 可存取的資源由目前授權範圍決定。

請求​

Base URL:https://api.bluehola.com

參數​

名稱位置必填類型/約束說明
idpath是string回呼端點 ID,whe_...
statusquery否pending / queued / delivered / failed只回傳該狀態的投遞。其他取值回傳 400,不會被忽略
limitquery否integer,1–100每頁筆數,預設 50。超出範圍回傳 400
beforequery否string上一頁回傳的 nextCursor
curl "https://api.bluehola.com/v1/webhook-endpoints/whe_123/deliveries?status=failed&limit=20" \
-H "Authorization: Bearer <API_KEY>"

回應​

狀態碼說明
200OK
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[].statuspending / 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 只能讀取其客戶主體名下端點的投遞紀錄。