# Webhook 测试请求返回 200，怎样确认事件真的送到了？

[规范网址](https://social2api.com/guides/social2api-webhook-verify-delivery-status/)

在 Social2api 发出 Webhook 测试后，检查 delivery.status，而不只看调用测试接口的 HTTP 状态。接收端的响应码保存在 delivery.statusCode。

## Agent 提示词

~~~~text
请在 Social2api 使用Webhook 端点与投递记录，执行以下任务。
目标：区分测试 API 的 HTTP 成功与接收端的实际投递状态。
输入与对照示例：测试接口返回 200 但明细显示 failed、statusCode 为 404，说明目标接收路径未找到。修正目标 URL 后，用下一次投递的独立 eventId 对照两边记录。
需要登录账户。先核对权限、设置和当前值，执行任何配置变更前请由我确认。
按以下步骤完成：在已保存的端点发出测试。打开该次投递，记录 eventId、接收地址、投递状态和接收端响应码。 status 为 failed 时查看 error。statusCode 为 null 表示没有收到接收端的 HTTP 响应；收到 4xx 时检查目标接收路径和签名验证。 修正后重发一个测试，核对接收端与控制台都记录了交付结果。暂停的端点也可测试，测试跟订阅的实时事件分开看。
交付能核对的结果和必要字段：delivery.status、delivery.statusCode、delivery.error、eventId、type。注明来源或限制，并以本页为操作参考。
https://social2api.com/guides/social2api-webhook-verify-delivery-status/
~~~~

[打开 Webhook 投递与失败记录](https://social2api.com/#settings/webhooks)

## 本页用到的 Social2api 接口

| 接口与参数文档 | 用途 |
| --- | --- |
| [列出 Webhook 与投递记录](https://social2api.com/docs/api/webhooks-list/) · GET /api/settings/webhooks | 读取端点、订阅事件及最近 100 条投递记录。 |
| [发送 Webhook 测试事件](https://social2api.com/docs/api/webhooks-test/) · POST /api/settings/webhooks/{id}/test | 立即投递 webhook.test，并返回单次投递结果。 |

## 在 Social2api 使用Webhook 端点与投递记录

1. 在已保存的端点发出测试。打开该次投递，记录 eventId、接收地址、投递状态和接收端响应码。
2. status 为 failed 时查看 error。statusCode 为 null 表示没有收到接收端的 HTTP 响应；收到 4xx 时检查目标接收路径和签名验证。
3. 修正后重发一个测试，核对接收端与控制台都记录了交付结果。暂停的端点也可测试，测试跟订阅的实时事件分开看。

## 查看最近失败的投递记录

在 /#settings/webhooks 找到已保存的目标端点并点击发送测试。该动作会向接收地址发出 webhook.test。发送测试返回 200 时仍需检查 delivery.status。

如果投递失败，可在已登录的 Social2api 页面运行以下只读查询。用 endpointId 和 eventId 找到该次投递。statusCode 为空时检查连接或超时，404 时检查接收路径。修正后重发测试，再用新 eventId 对照两边记录。

~~~~javascript
{
  const response = await fetch("/api/settings/webhooks?status=failed", { cache: "no-store" });
  if (!response.ok) throw new Error("HTTP " + response.status);
  const { deliveries } = await response.json();
  console.table(deliveries.filter(({ type }) => type === 'webhook.test').map(
    ({ endpointId, eventId, status, statusCode, error }) => ({ endpointId, eventId, status, statusCode, error })));
}
~~~~

## 用事件 ID 核对这一次投递

将 EVENT\_ID 替换为测试接口 delivery.eventId。在已登录的 Social2api 页控制台运行只读查询。未出现时检查近期 100 条窗口、接收端日志和正在看的账号。delivered 表示 2xx，failed 且带 HTTP 状态表示接收端拒绝，状态码为 null 时未收到有效响应。

~~~~javascript
const EVENT_ID = 'evt_替换为本次测试事件';
const response = await fetch('/api/settings/webhooks', { cache: 'no-store' });
if (!response.ok) throw new Error('HTTP ' + response.status);
const { deliveries } = await response.json();
const matching = deliveries.filter(({ eventId, type }) => eventId === EVENT_ID && type === 'webhook.test');
if (!matching.length) console.log('No matching delivery in this window');
console.table(matching.map(({ endpointId, status, statusCode, error }) => ({
  endpointId, status, statusCode, error,
  observed: status === 'delivered' ? 'delivered' : statusCode === null ? 'no-response' : 'rejected',
})));
~~~~

## 操作示例与核对

测试接口返回 200 但明细显示 failed、statusCode 为 404，说明目标接收路径未找到。修正目标 URL 后，用下一次投递的独立 eventId 对照两边记录。

## 需要核对的字段

delivery.status、delivery.statusCode、delivery.error、eventId、type。

## 接口文档

- [列出 Webhook 与投递记录](https://social2api.com/docs/api/webhooks-list/)
- [发送 Webhook 测试事件](https://social2api.com/docs/api/webhooks-test/)

## 相关用户讨论

- [用户讨论 · YouTube · Which unified API tool works best in n8n for domain traffic, social posts, and work email lookups?](https://www.reddit.com/r/n8n/comments/1y2is25/which_unified_api_tool_works_best_in_n8n_for/)
- [用户讨论 · 小红书、抖音 · 公开数据工具遇到上游变化，怎么控制维护成本？](https://x.com/ReignSwords/status/2116310294167482672)

## 相关指南和问答

- [小红书、抖音、微信视频号的数据 API 怎么选？](https://social2api.com/answers/chinese-social-data-api-selection/)

[打开 Webhook 投递与失败记录](https://social2api.com/#settings/webhooks)
