Send Template Message
Send an approved WhatsApp template message to a specific phone number.
POST
/v1/messages/send-templateRequest Body
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| phoneNumber | string | Yes | Recipient phone number in E.164 format (e.g. +919876543210). |
| templateId | string | Yes | The internal ID of the approved template (as shown in the Template ID Reference section). |
| variables | object | No | Key-value pairs for variables, e.g. { "1": "Rahul" }. |
| mediaHeader | object | No | Object containing { type: "image", link: "..." } for media templates. If using an image type, the format must be JPEG or PNG. |
Implementation Examples
const payload = {
phoneNumber: "+919876543210",
templateId: "cm0j1u8v0000...",
variables: { "1": "Rahul", "2": "20% OFF" }
};
const response = await fetch('https://api.wadoot.com/v1/messages/send-template', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY_HERE'
},
body: JSON.stringify(payload)
});