我正在尝试解开下面代码的谜团。我编写了有关发送模板消息的元文档的代码。每次我尝试发送消息时,我都会收到如下错误消息
{ "error": { "message": "(#132012) Parameter format does not match format in the created template", "type": "OAuthException", "code": 132012, "error_data": { "messaging_product": "whatsapp", "details": "header: Format mismatch, expected DOCUMENT, received UNKNOWN" }, "fbtrace_id": "A3xxC_8Mj0HOPgQhvFpdCOa" } }
**我的代码是**
{ "messaging_product": "whatsapp", "recipient_type": "individual", "to": "{{Recipient-Phone-Number}}", "type": "template", "template": { "name": "test_temp", "language": { "code": "en_US" } }, "components": [ { "type": "header", "parameters": [ { "type": "document", "document": { "filename": "Purchase Note - 123456789.pdf", "link": "https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "123456789" } ] } ] }
我不明白我的代码有什么问题,我尝试了很多方法来改变我的代码,但没有任何效果。请帮我解决这个问题。
我尝试使用 ID 而不是链接,但代码仍然无法正常工作
您的代码中有语法错误
试试这个
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "{{Recipient-Phone-Number}}",
"type": "template",
"template": {
"name": "test_temp",
"language": {
"code": "en_US"
},
"components": [
{
"type": "header",
"parameters": [
{
"type": "document",
"document": {
"filename": "Purchase Note - 123456789.pdf",
"link": "https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf"
}
}
]
},
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "123456789"
}
]
}
]
}
}
“组件”必须位于“模板”内:{}