批量重发通知
使用此端点按筛选条件批量重发 webhook 通知。
可用环境
- 生产环境
https://api.gateway.com.br/dispatcher
端点
- 方法:
POST - 端点:
/request/resend - 认证方式:Bearer token
请求体规则
ℹ️ 条件规则
以下两种方式必须任选其一发送:
startDate+endDate(未传referenceId时)referenceId(未传startDate和endDate时)
若要覆盖 DTO 的全部字段,请参考下面两种场景的完整示例。
ℹ️ 日期不能是未来时间
startDate 和 endDate 必须是有效的 ISO 8601 日期,且不能是未来时间。
示例:
2026-03-24T00:00:00Z
| 名称 | 类型 | 必填 | 说明 | 校验规则 |
|---|---|---|---|---|
startDate | string (ISO 8601) | 条件必填 | 筛选的起始日期 | 未传 referenceId 时必填。不能是未来时间 |
endDate | string (ISO 8601) | 条件必填 | 筛选的结束日期 | 未传 referenceId 时必填。不能是未来时间 |
referenceId | string | 条件必填 | 指定通知的关联 ID | 未传 startDate 和 endDate 时必填 |
status | string[] (enum) - RECEIVED, SENT, FAILED, ERROR | 否 | 用于筛选的状态列表 | 必须为非空数组 |
tags | string[] | 否 | 用于筛选的标签列表 | 非空数组,最多 10 项 |
overrideURL | string (URL) | 否 | 重发时用于替换通知当前目标地址的 URL(通知将发往该地址) | 必须为有效的 URL |
请求示例(startDate + endDate 场景)
- cURL
- JavaScript
curl --request POST \
--url https://api.gateway.com.br/dispatcher/request/resend \
--header 'Authorization: Bearer your-jwt-token' \
--header 'Content-Type: application/json' \
--data '{
"startDate": "2026-03-23T00:00:00Z",
"endDate": "2026-03-24T23:59:59Z",
"status": ["RECEIVED", "SENT", "FAILED", "ERROR"],
"tags": ["webhook", "notification"],
"overrideURL": "https://api.example.com/webhooks/custom-callback"
}'
const payload = {
startDate: '2026-03-23T00:00:00Z',
endDate: '2026-03-24T23:59:59Z',
status: ['RECEIVED', 'SENT', 'FAILED', 'ERROR'],
tags: ['webhook', 'notification'],
overrideURL: 'https://api.example.com/webhooks/custom-callback'
};
const response = await fetch('https://api.gateway.com.br/dispatcher/request/resend', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-jwt-token',
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
请求示例(referenceId 场景)
- cURL
- JavaScript
curl --request POST \
--url https://api.gateway.com.br/dispatcher/request/resend \
--header 'Authorization: Bearer your-jwt-token' \
--header 'Content-Type: application/json' \
--data '{
"referenceId": "123e4567-e89b-12d3-a456-426614174001",
"status": ["RECEIVED", "SENT", "FAILED", "ERROR"],
"tags": ["webhook", "notification"],
"overrideURL": "https://api.example.com/webhooks/custom-callback"
}'
const payload = {
referenceId: '123e4567-e89b-12d3-a456-426614174001',
status: ['RECEIVED', 'SENT', 'FAILED', 'ERROR'],
tags: ['webhook', 'notification'],
overrideURL: 'https://api.example.com/webhooks/custom-callback'
};
const response = await fetch('https://api.gateway.com.br/dispatcher/request/resend', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-jwt-token',
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
成功响应
| 状态码 | 说明 |
|---|---|
201 Created | 请求已受理,重发将进入处理流程 |
ℹ️ 响应体
此端点返回 201,没有响应体。
可能的错误
| 状态码 | 说明 | 处理方式 |
|---|---|---|
| 400 | 请求无效 | 请检查请求体格式与条件规则 |
| 401 | 凭据无效 | 请检查您的 token |
| 403 | 无权限或未授权 | 请检查 resend_dispatcher 权限范围 |
| 422 | 实体无法处理 | 请检查字段与校验规则 |
| 500 | 内部错误 | 请联系技术支持 |