WhatsApp Cloud API 错误代码
这里列出我们记录的所有 WhatsApp Cloud API 错误代码,并在一张表中说明每个代码的含义,以及重试是否有帮助。大多数情况下没有帮助:这些错误是确定性的,同一个请求会以同样方式失败,而重试循环只会让错误请求最终触发速率限制。
Request
| Code | What it means | Retry |
|---|---|---|
| 100 | A parameter is unsupported, misspelled or malformed. | No |
| 131008 | A required parameter was not included at all. | No |
| 131009 | A parameter is present with a value the endpoint rejects. | No |
| 131021 | Sender and recipient are the same number. | No |
| 131051 | The message type is not supported, often a Coexistence limit. | No |
| 131052 | Meta could not download media a customer sent. | No |
| 131053 | Meta could not upload media you sent. Size, format or reach. | No |
Template
| Code | What it means | Retry |
|---|---|---|
| 132000 | The number of parameters does not match the template. | No |
| 132001 | No template exists with that name and language pair. | No |
| 132007 | The template breaks messaging policy. Rewrite and resubmit. | No |
| 132012 | Parameter format does not match what the template defines. | No |
| 132015 | The template is paused after a quality decline. Temporary. | Wait |
| 132016 | The template is permanently disabled. It will not come back. | No |
Window and recipient
Registration and PIN
| Code | What it means | Retry |
|---|---|---|
| 131045 | The number was never registered for Cloud API messaging. | No |
| 133010 | The number is not registered. Registration must be completed. | No |
| 133006 | The number must be verified before it can be registered. | No |
| 133005 | The two-step verification PIN was wrong. Stop guessing. | No |
| 133008 | Too many PIN attempts. Registration is locked for a period. | Wait |
Access and account
| Code | What it means | Retry |
|---|---|---|
| 190 | The access token expired or was invalidated. | No |
| 368 | The account is restricted after a policy violation. | No |
| 131031 | The account is restricted, or its data does not match Meta's. | No |
| 131042 | A payment problem on the business account blocks sending. | No |
| 131049 | Meta blocked the message to protect ecosystem health. | No |
Rate limits
Transient
Coexistence sync
如何阅读重试栏
它有 3 个值,选错值是整份参考资料中代价最高的错误。
否表示失败是确定性的。出问题的是请求、模板或收件人的状态,完全相同的请求会再次产生相同错误,同时消耗您之后会需要的吞吐量。是表示问题出在 Meta 一侧,退避重试确实可以解决。等待表示条件确实存在,但只是暂时的,例如会自行解除的限制或锁定。在解除前重试没有作用,还可能延长限制时间。
为什么大多数代码都不适合重试
因为平台会返回具体代码,而不是笼统的错误。参数格式错误、不存在的模板、已关闭的消息窗口和已选择退出的收件人,都会在响应返回时确定,因此 Meta 会明确指出问题,而不是含糊地失败。
- 请求问题不会在第二次尝试时自动变正确。
- 模板问题存在于模板本身,请求无法改变它。
- 窗口或选择退出问题涉及收件人的状态,而不是您的状态。
- 账户限制是一项决定,重试不是申诉。
收到这些代码时要记录什么
记录足够的信息,让您无需重现问题也能诊断。这就是 5 分钟修复和整天猜测之间的区别。
- 完整错误响应,包括 trace id,这是 Meta 支持团队要求的信息。
- 实际发送的请求正文,而不是您原本打算发送的内容。两者之间的差异通常就是错误所在。
- phone number id,这样可以区分单个号码的问题和整个账户的问题。
- 时间戳,这样可以对照该时刻的连接状态检查失败原因。
只存在于 Coexistence 中的代码
有 2 个。它们看起来像普通的发送失败,因此容易让人困惑。2593107 和 2593108 都与聊天记录同步有关,也就是号码首次连接时,从 WhatsApp Business 应用复制近期对话的步骤。
它们不是消息错误,也不表示连接失败。如果同步超过限制或在窗口之外运行,号码仍会保持连接并正常发送,只是复制的历史记录少于预期。把它们看成连接中断,会导致有人断开连接后重新开始,这样只会丢失更多历史记录,而不是恢复记录。
常见问题
哪些错误应该重试?
131016 和 131000,使用指数退避。130429、132015 和 133008 等待后会自行恢复。其他错误都是确定性的。
错误代码是否表示我的号码已断开连接?
通常不是。大多数代码涉及请求、模板或收件人。连接问题通常会以账户和质量 Webhook 的形式出现,而不是发送错误。
什么是 trace id?
它是错误响应中的标识符,让 Meta 支持团队能够找到具体请求。每次失败都应记录它,否则支持工单无法获得处理。
这些代码在每个服务商那里都相同吗?
是。它们来自 Meta 的 Cloud API,因此无论哪家服务商连接该号码,代码都相同。服务商只能影响这些错误能多清楚地传达给您。
准备开始了吗?
几分钟即可设置 WhatsApp Coexistence,而不是几个月。应用会继续在手机上运行。
开始免费试用7 天内不收取任何费用。随时取消。