我在Whatsapp中创建了下面的模板。我想在API调用中设置参数值。正确的有效载荷是什么?我一直在跟踪Meta文档,每次我都会出错。请帮帮忙。
模板:
成功地收到了订单{{1}}。
我使用了这个有效载荷:
{
"messaging_product": "whatsapp",
"to": "918456712349",
"type": "template",
"template": {
"name": "order_notification",
"language": {
"code": "en_US"
}
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "135345345"
}
]
}
]
}
,但我仍然得到这个错误
{
"error": {
"message": "(#132000) Number of parameters does not match the expected number of params",
"type": "OAuthException",
"code": 132000,
"error_data": {
"messaging_product": "whatsapp",
"details": "body: number of localizable_params (0) does not match the expected number of params (1)"
},
"error_subcode": 2494002,
"fbtrace_id": "AzPa-uWXctIcdNVu0Lf3Fic"
}
}
发布于 2022-10-18 17:00:36
更改参数类型"header",此代码将为我运行:
{ "messaging_product":"whatsapp","to":"918456712349",“类型”:“模板”,“模板”:{“名称”:"order_notification",“语言”:{“代码”:"en_US“},”组件“:[{”类型“:”标题“,”参数“:{”类型“:”文本“,”文本“:"xxxxxxx”}
https://stackoverflow.com/questions/72322149
复制相似问题