跳到主要内容

查询通知

使用此端点按 id 查询指定通知的详细信息。

可用环境​

https://api.gateway.com.br/dispatcher

端点​

  • 方法:GET
  • 端点:/request/{id}
  • 认证方式:Bearer token

路径参数​

名称类型必填说明校验规则
idstring是通知的标识必须为有效的通知 ID

请求示例​

curl --request GET \
--url https://api.gateway.com.br/dispatcher/request/553e8400-e29b-41d4-a716-446655440000 \
--header 'Authorization: Bearer your-jwt-token'

成功响应​

字段类型必填说明
idstring是通知 ID
hashstring是通知的哈希值
tenantstring是通知所属的租户
urlstring是通知的目标地址
referenceIdstring是关联 ID
bodyobject | string是通知中发送的报文
tagsstring[]是通知的标签
statusstring (enum) - RECEIVED, SENT, FAILED, ERROR是通知的当前状态
statusHistoryarray是状态历史(参见子对象 StatusHistory)
createdAtstring (ISO)是创建时间
updatedAtstring (ISO)是最后更新时间
executionsarray是通知的执行记录(参见子对象 Execution)
errorstring是通知的错误信息(无错误时返回 null)

子对象​

StatusHistory(列表项)​

字段类型必填说明
statusstring是历史中记录的状态
datestring (ISO)是状态变更的时间
durationInMillisecondsnumber否上一个状态的持续时长,单位为毫秒

Execution (item)​

字段类型必填说明
urlstring是本次执行调用的地址
headersobject否本次执行发送的请求头
createdAtstring (ISO)是本次执行的时间
responseobject是本次执行的响应(参见子对象 ResponseVo)
userIdstring是与本次执行关联的用户标识
storeIdstring是与本次执行关联的店铺标识

ResponseVo​

字段类型必填说明
statusCodenumber是目标返回的 HTTP 状态码
bodyany是目标返回的响应体
responseTimenumber是本次执行的响应耗时,单位为毫秒

响应示例(包含全部字段)​

{
"id": "553e8400-e29b-41d4-a716-446655440000",
"hash": "ffb2f88d-a863-4a03-bf53-81e7ef73db31",
"tenant": "splitwave.com.br",
"url": "https://api.example.com/webhook",
"referenceId": "123e4567-e89b-12d3-a456-426614174001",
"body": {
"event": "PAYMENT_APPROVED",
"amount": 1000
},
"tags": ["webhook", "notification"],
"status": "RECEIVED",
"statusHistory": [
{
"status": "RECEIVED",
"date": "2026-03-24T10:00:00.000Z",
"durationInMilliseconds": 1000
},
{
"status": "FAILED",
"date": "2026-03-24T10:00:01.000Z",
"durationInMilliseconds": 4000
},
{
"status": "SENT",
"date": "2026-03-24T10:00:05.000Z"
}
],
"createdAt": "2026-03-24T10:00:00.000Z",
"updatedAt": "2026-03-24T10:00:05.000Z",
"executions": [
{
"url": "https://api.example.com/webhooks/order-events",
"headers": {
"Content-Type": "application/json",
"X-Splitwave-Signature": "sha256=abcdef123456"
},
"createdAt": "2026-03-24T10:00:01.000Z",
"response": {
"statusCode": 500,
"body": "Internal Server Error",
"responseTime": 1200
},
"userId": "11111111-1111-1111-1111-111111111111",
"storeId": "22222222-2222-2222-2222-222222222222"
},
{
"url": "https://api.example.com/webhooks/order-events",
"headers": {
"Content-Type": "application/json",
"X-Splitwave-Signature": "sha256=abcdef123456"
},
"createdAt": "2026-03-24T10:00:05.000Z",
"response": {
"statusCode": 200,
"body": "ok",
"responseTime": 350
},
"userId": "11111111-1111-1111-1111-111111111111",
"storeId": "22222222-2222-2222-2222-222222222222"
}
],
"error": "Connection timeout on first attempt"
}

可能的错误​

状态码说明处理方式
401凭据无效请检查您的 token
403无权限或未授权请检查 get_dispatcher 权限范围
404未找到通知请检查传入的 id
500内部错误请联系技术支持