§ API REFERENCE
查询 Webhook投递事件
GET
/webhook-eventsscope: webhook:manage查询事件状态、尝试次数、末次状态码与重试时间;不返回payload、PII或secret。
鉴权:Authorization: Bearer <access_token>。查询参数:status、event_type、limit(1..100)。
§ 1
请求信息
REQUESTGET https://api.lingxiguangnian.com/api/open/v1/webhook-events请求头
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
Authorization | string | 是 | Bearer <access_token>。由 POST /token 换取,有效期 2 小时;api_secret 不得直连业务端点(→ 401)。 |
§ 2
调用示例
EXAMPLESGET /webhook-events
curl "https://api.lingxiguangnian.com/api/open/v1/webhook-events?limit=20" -H "Authorization: Bearer oat_xxxxxxxxxxxxxxxx"
§ 3
返回结果
RESPONSE返回字段
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
events[] | object[] | 是 | event_id、subscription_id、event_type、status、attempt_count、last_status_code、last_failure_code、next_retry_at及时间。 |
RESPONSE · JSON
{ "success": true, "data": { "events": [{ "event_id": "22222222-2222-4222-8222-222222222222", "event_type": "report.generated", "status": "DELIVERED", "attempt_count": 1, "last_status_code": 204 }] } }§ 4
端点错误码
ERRORS通用鉴权、scope 与限流错误见「使用概述」;下表为本端点专属错误。
| HTTP | error_code | 触发条件 |
|---|---|---|
| 500 | open_api.webhook_query_failed | Webhook事件查询失败。 |
契约真源:apps/m-master/src/app/api/open/v1/webhook-events/route.ts