Meta Tech Provider
WhatsApp 错误 131008:缺少必需参数
错误 131008 表示请求缺少必需参数。它比错误 100 更具体,也更有用。错误 100 通常涵盖格式错误的参数,而 131008 明确指出字段缺失,而不是字段值错误。
通常缺少什么
有些字段看似可选,实际上并非如此,所以总是反复出现同几项。
- messaging_product,每次发送都必须设为 whatsapp。
- 需要该字段的消息结构中的 recipient_type。
- 使用模板发送时的语言对象,即使只有一种语言也必须提供。
- 定义了变量的模板中的 components,此时空列表与省略字段并不相同。
为什么这是好消息
因为这是这一类错误中最具体的一种。错误 100 只告诉您某处的参数有问题,而 131008 明确告诉您必需参数完全不存在,因此您只需检查端点的必需字段列表。
修复方法是阅读所调用端点的参考文档,并将请求与其必需字段集合逐一核对。这只需几分钟,也正是为什么日志中值得将此错误与 100 区分,而不是都归为错误请求。
常见错误
- 将它与错误 100 视为相同。这个错误指出的是缺失,因此更具体。
- 把空的 components 数组当作省略字段发送。对 API 来说,两者不同。
- 省略 messaging_product。每次发送都必须提供它,这是最常见的单一原因。
使用 EasyCoexistence 完成这些操作
EasyCoexistence 会返回构建请求所需的电话号码 ID 和访问令牌,因此其中的值就是 Meta 持有的值,而不是设置时抄录的值。
常见问题
缺少哪个参数?
响应中会列出该参数。若响应未列出,端点参考文档会提供必需字段集合。
messaging_product 真的必需吗?
是的,每次发送都必须设为 whatsapp。这是最常见的遗漏字段。
这和 100 相同吗?
不相同。100 针对已存在但错误的参数,而 131008 针对缺失的参数。
重试有帮助吗?
没有。请求是确定性的,在添加字段前,每次都会以相同方式失败。
继续阅读
WhatsApp error 100: invalid parameterError 100 means a parameter was unsupported, misspelled or malformed. It is the broadest error on the platform and it never clears by retrying.WhatsApp error 131009: invalid parameter valueError 131009 means a parameter was present with a value the endpoint does not accept. Common causes: locale codes, phone formats and enum values.WhatsApp error 132000: parameter count mismatchError 132000 means the number of variables you sent does not match the number the template defines. How to count them and why it appears after an edit.WhatsApp Coexistence: the app and the API on one numberCoexistence runs the WhatsApp Business app and the Cloud API on the same number at once. What it changes, what it does not, and how a number gets connected.WhatsApp error 131051: unsupported message typeError 131051 means the message type is not supported. On a Coexistence number some types are unavailable, which is the common cause.WhatsApp Cloud API error codesEvery WhatsApp Cloud API error code in one table: what each one means, whether retrying helps, and the page that covers it in full.
准备开始了吗?
几分钟即可设置 WhatsApp Coexistence,而不是几个月。应用会继续在手机上运行。
开始免费试用验证时间