/v1/whatsapp/templatesStart sending whatsapp template messages through the Elora messaging API. To get the sender's mobile number after completing onboarding, navigate to the dashboard and select:WhatsApp Onboarding → Onboarding Status → Phone Number
Before sending, you must create and get approval for your message templates in your WhatsApp Business Manager. Refer to Meta's Documentation.
Once approved, send a POST request to our API. Instead of a single "Message" string, you must provide a Components array. Each item in this array corresponds to the placeholders in your template, in the order they appear.
Sender mobile number. This is the business mobile number. Starts with mandatory +, then 7 to 15 digits. eg '+2547xxxxxxxx'.
Your components array must map to your template variables as perMeta's Documentation.
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Jessica"
}
]
}
]For templates like: "Hello {{1}}"
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"parameter_name": "name",
"text": "Jessica"
}
]
}
]For templates like: "Hello {{name}}"
System Constraints:
text parameter is limited to 1,024 characters.The Elora messaging API will acknowledge the request by returning the following HTTP status code:
curl -X POST "https://api.eloratechnology.com/v1/whatsapp/templates" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Sender-Number: +2547xxx" \
-d '{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "+2547xxx",
"type": "template",
"template": {
"name": "order_confirmation",
"language": {
"code": "en_US"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Jessica"
},
{
"type": "text",
"text": "SKBUP2-4CPIG9"
}
]
}
]
}
}'
{
"messageId": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}