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