WhatsApp API
/
API
WhatsApp Business API
Integrate official WhatsApp Business API messaging. Send pre-approved templates for marketing, utility receipts, authentication codes, or hold two-way conversations with customers.
Send Template Message
Dispatch a pre-approved template message to a user. All templates must be registered and approved in your Meta Business Suite.
curl -X POST https://api.msgx.in/v1/whatsapp/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919999999999",
"type": "template",
"template": {
"name": "welcome_offer",
"language": { "code": "en_US" },
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "Rahul" }
]
}
]
}
}'
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| to | String | Yes | Recipient's phone number in E.164 format (e.g. +919999999999). |
| type | String | Yes | Must be set to template or text. |
| template | Object | Conditional | Object containing the template name, language, and dynamic variable components. |