I have integrated Salesforce to WhatsApp following the documentation provided by meta - https://developers.facebook.com/
I have hit the below API with the body to send the messages and gets the success response, but the messages are not delivered to the mobile whatsApp. Highly appreciate yourhelp.
POST - Endpoint -> https://graph.facebook.com/v18.0/{business_phone_number_id}/messages
Body:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "PHONE_NUMBER", // Mobile number
"type": "text",
"text": { // the text object
"preview_url": false,
"body": "MESSAGE_CONTENT"
}
}
For the same API, templated messages are delivered other than, no other format messages are delievered.
Templated body with the same Endpoint
{
"messaging_product": "whatsapp",
"to": "PHONE_NUMBER",
"type": "template",
"template": {
"name": "hello_world",
"language": {
"code": "en_US"
}
}
}
Got the solution. For the trail account - First we have to send the template and then receiver should reply to the template. Then from salesforce we can send text messages.