Elora Logo

Home

Introduction

Errors

WhatsApp

Send Message

Send Template

Incoming Messages

Incoming Notifications

Post/v1/whatsapp/templates

Send Template Message

Start 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

Step 1: Create your Template

Before sending, you must create and get approval for your message templates in your WhatsApp Business Manager. Refer to Meta's Documentation.

Step 2: Send to our Endpoint

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.

Header Parameters

X-Sender-NumberstringRequired

Sender mobile number. This is the business mobile number. Starts with mandatory +, then 7 to 15 digits. eg '+2547xxxxxxxx'.

🛠 Formatting "Body Parameters"

Your components array must map to your template variables as perMeta's Documentation.

1. Positional (Standard)

"components": [
          {
            "type": "body",
            "parameters": [
              { 
                "type": "text", 
                "text": "Jessica" 
              }
            ]
          }
        ]

For templates like: "Hello {{1}}"

2. Named (Advanced)

"components": [
          {
            "type": "body",
            "parameters": [
              { 
                "type": "text", 
                "parameter_name": "name", 
                "text": "Jessica" 
              }
            ]
          }
        ]

For templates like: "Hello {{name}}"

System Constraints:

  • Phone Number (to): Starts with mandatory + , then 7 to 15 digits (e.g., +2547xxxxxxxx).
  • Body Content: Each text parameter is limited to 1,024 characters.

Success Acknowledgement

The Elora messaging API will acknowledge the request by returning the following HTTP status code:

202
Accepted

WhatsApp Messaging Rules

  • Inbound messages open a 24-hour service window.
  • Inside the window: Send any message (text, media, etc.).
  • Outside the window: Only template messages are allowed.
Request Example
cURL

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"
            }
          ]
        }
      ]
    }
  }'
Response
json
{
  "messageId": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}