Hi everyone,
I'm having issues sending WhatsApp template messages.
I'm using the endpoint:
https://api.sendpulse.com/whatsapp/contacts/sendTemplateByPhone
Request body:
{
"bot_id": "xxxxxxxx",
"phone": "xxxxxxx",
"template": {
"name": "xxx_xxx",
"language": {
"policy": "deterministic",
"code": "pt_BR"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "xxxxx"
},
{
"type": "text",
"text": "xxxxx"
}
]
},
{
"type": "button",
"sub_type": "quick_reply",
"index": 0,
"parameters": [
{
"type": "payload",
"payload": {
"to_chain_id": "xxxxxxxxx"
}
}
]
}
]
}
}The issue is:
The first message is sent successfully
The second message fails with the following error:
{
"success": false,
"data": null,
"errors": {
"contact_id": [
"Contact is invalid"
]
},
"error_code": 400
}Additionally, the contact is being flagged as duplicated for some reason.
This happens for every phone number I test.
I also tried a different approach:
Check if the contact exists using:
https://api.sendpulse.com/whatsapp/contacts/getByPhoneIf it exists, send the template using:
https://api.sendpulse.com/whatsapp/contacts/sendTemplate
However, I get the exact same error.
I tried contacting support, but no one seems to know what is happening.
What could be causing this issue? What am I doing wrong?