Dynamic workflow
Follow these two steps to send any template message (including text, media, buttons, and carousels):Step 1: Fetch the payload skeleton
Send a request to the Fetch Payload Skeleton endpoint to get the exact JSON structure needed for your template:Sample response
Depending on the template type, the endpoint returns the corresponding payload structure. For example, a marketing template with header media, body text, and a discount button returns:Step 2: Copy, customize, and send
- Copy the
dataobject from the response above. - Replace the placeholders (e.g. phone number, image URLs, custom names) with your actual recipient details and variables.
- Paste and send the payload to the Send Template Message endpoint (
POST /api/templates/external/message/send).
Parameter details
Here are the primary parameters included in the payload skeleton:| Parameter | Type | Required | Description |
|---|---|---|---|
templateId | string | Yes | The unique UUID of the WhatsApp template. |
recipientPhoneNumber | string | Yes | Recipient’s phone number with country code (e.g., 919999999999). |
countryCode | string | Yes | Country code for the phone number (e.g., +91). |
variableMapping | object | No | Pre-structured variable mapping for header, body, buttons, or carousel fields. |
