我正在使用 Whatsapp Cloud API 在使用 Flutter 制作的 Web 应用程序中发送模板消息。 我必须在标题和正文的有效负载中发送一些参数。 我遵循了docs中的所有指南。
错误:
{错误:{消息:(#132000)参数数量与预期的参数数量不匹配,类型:OAuthException,代码:132000,错误数据:{messaging_product:whatsapp,详细信息:标头:localizable_params(0)的数量不匹配匹配参数的预期数量 (1)}, fbtrace_id: AVisIaGrwzDFhg6VkPQMAn5}}
Whatsapp 模板:
我发送的有效载荷:
Map data = {
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": to.toString(),
"type": "template",
"template": {
"name": "coupon",
"language": {"code": "en"}
},
"components": [
{
"type": "header",
"parameters": [
{"type": "text", "text": "User Name"}
]
},
{
"type": "body",
"parameters": [
{"type": "text", "text": "Company"},
{"type": "text", "text": "Coupon"},
]
}
]
};
我已经附加了所有必需的参数,但仍然出现错误。
我做错了什么吗?