查询通知
使用此端点按 id 查询指定通知的详细信息。
可用环境
- 生产环境
https://api.gateway.com.br/dispatcher
端点
- 方法:
GET - 端点:
/request/{id} - 认证方式:Bearer token
路径参数
| 名称 | 类型 | 必填 | 说明 | 校验规则 |
|---|---|---|---|---|
id | string | 是 | 通知的标识 | 必须为有效的通知 ID |
请求示例
- cURL
- JavaScript
curl --request GET \
--url https://api.gateway.com.br/dispatcher/request/553e8400-e29b-41d4-a716-446655440000 \
--header 'Authorization: Bearer your-jwt-token'
const response = await fetch('https://api.gateway.com.br/dispatcher/request/553e8400-e29b-41d4-a716-446655440000', {
method: 'GET',
headers: {
'Authorization': 'Bearer your-jwt-token'
}
});
const data = await response.json();
成功响应
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 是 | 通知 ID |
hash | string | 是 | 通知的哈希值 |
tenant | string | 是 | 通知所属的租户 |
url | string | 是 | 通知的目标地址 |
referenceId | string | 是 | 关联 ID |
body | object | string | 是 | 通知中发送的报文 |
tags | string[] | 是 | 通知的标签 |
status | string (enum) - RECEIVED, SENT, FAILED, ERROR | 是 | 通知的当前状态 |
statusHistory | array | 是 | 状态历史(参见子对象 StatusHistory) |
createdAt | string (ISO) | 是 | 创建时间 |
updatedAt | string (ISO) | 是 | 最后更新时间 |
executions | array | 是 | 通知的执行记录(参见子对象 Execution) |
error | string | 是 | 通知的错误信息(无错误时返回 null) |
子对象
StatusHistory(列表项)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
status | string | 是 | 历史中记录的状态 |
date | string (ISO) | 是 | 状态变更的时间 |
durationInMilliseconds | number | 否 | 上一个状态的持续时长,单位为毫秒 |
Execution (item)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
url | string | 是 | 本次执行调用的地址 |
headers | object | 否 | 本次执行发送的请求头 |
createdAt | string (ISO) | 是 | 本次执行的时间 |
response | object | 是 | 本次执行的响应(参见子对象 ResponseVo) |
userId | string | 是 | 与本次执行关联的用户标识 |
storeId | string | 是 | 与本次执行关联的店铺标识 |
ResponseVo
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
statusCode | number | 是 | 目标返回的 HTTP 状态码 |
body | any | 是 | 目标返回的响应体 |
responseTime | number | 是 | 本次执行的响应耗时,单位为毫秒 |
响应示例(包含全部字段)
{
"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 | 内部错误 | 请联系技术支持 |