Send template message
Sending Templates via API
To send a template to users, partners can utilize the API by including the Partner Token and Auth Token in the request headers for authentication.
How to get the Partner Access Token?
In order to get partner access token you can write an email to partners@easysocial.io and we will be happy to share a partner access token with you.
How can a Business generate a Token?
If you're unsure how to generate a token, click here
POST
https://api.easysocial.in/partners//wa-templates/:contactNumber/:templateId/send-template
Key Parameters
- contactNumber: The recipient's phone number where the template will be sent.
- templateId: A unique identifier assigned to each template, used to specify which template should be delivered.
Templates are created with predefined variables such as Body 1, Body 2, Header 1, etc. Each template message may or may not include variables, and the number of variables varies depending on the template. The header can include text, a photo, a video, or a document, as specified during the template's creation. If you add any wrong value in a header variable , it would result in failure while sending the message. When the template is sent, the values of these variables are dynamically updated in the message.
Example request
curl --location '/wa-templates/:contactNumber/:templateId/send-template' \
--header 'partner-token;' \
--header 'auth-token;' \
--header 'Content-Type: application/json' \
--data '{
"body1": "Pablo",
"body2": "860198-230332",
"header1": "<MEDIA LINK>"
}'
Example response
{
"status": 200,
"success": true,
"message": "successfully sent!"
}