Template messages are useful when you try to send the same type of message to a number of customers (notifications, remninders, etc.). You can also send them first to the customers even if you have never messaged the customer. And they don’t have the 24-hr reply window constraint as regular messages do.
Below is an example to send a template message to a given WhatsApp number. Note the template has to be created and approved in your WhatsApp Manager, which is part of the Facebook Business Manager before sending. You can also contact us if you need help to create one.
curl --request POST \
--url https://api.connectly.ai/v1/businesses/<business_id>/send/whatsapp_templated_messages \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <YOUR_KEY_HERE>' \
--data '
{
"parameters": [
{
"name": "body_1",
"value": "value1"
},
{
"name": "body_2",
"value": "value2"
}
],
"number": "<WA_NUumber>",
"templateName": "<Template_name>",
"language": "en_US"
}'
To read more on how to send a template message, see /v1/businesses/{businessId}/send/whatsapp_templated_messages.