跳到主要内容

查看投递记录

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 只能读取其客户主体名下端点的投递记录。