Send Template — Dynamic CTA
Send an approved template that includes a URL button with a dynamic suffix. Common use cases: per-customer order tracking links, magic-login URLs, personalised landing pages.
The template is approved with a base URL like https://yourdomain.com/order/{{1}} and at send time you pass the variable value, which Meta substitutes into the button.
Endpoint
POST https://apis.splashifypro.com/api/v1/public/messageHeaders
| Header | Value |
|---|---|
Authorization | Basic YOUR_API_KEY |
Content-Type | application/json |
Request body
{
"phoneNumber": "9999999999",
"callbackData": "order_12345",
"type": "Template",
"template": {
"name": "template_name_here",
"languageCode": "en",
"bodyValues": [
"body_variable_value_1",
"body_variable_value_2"
],
"buttonValues": {
"1": [
"button_variable_value"
]
}
}
}| Field | Required | Notes |
|---|---|---|
template.bodyValues | yes (when body has variables) | One entry per {{n}} in the body |
template.buttonValues | yes | Map of {button_index: [variable_value]} — see below |
Button index — important
buttonValues is keyed by button index, starting at 0. If a template has two buttons:
0— Phone number button (no dynamic part — never goes inbuttonValues)1— URL button with a dynamic suffix
Then your payload has "buttonValues": { "1": ["value"] } — note the index "1", not "0".
If the template has only the URL button, it would be at index 0:
"buttonValues": { "0": ["value"] }Example
curl -X POST https://apis.splashifypro.com/api/v1/public/message \
-H "Authorization: Basic YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "9999999999",
"callbackData": "some text here",
"type": "Template",
"template": {
"name": "template_name_here",
"languageCode": "en",
"bodyValues": ["body_variable_value_1", "body_variable_value_2"],
"buttonValues": { "1": ["button_variable_value"] }
}
}'Successful response — 201 Created
{
"result": true,
"message": "Message created successfully",
"id": "2d14b3d9-5dc2-4a76-b139-7394cac5888f"
}Error — Template category mismatch
{
"result": false,
"message": "Message not sent. Template category mismatch: Expected 'utility', but received 'MARKETING'. Please update the request to match the approved template category."
}Tips
- Encode the suffix before passing it. If your dynamic value contains
&,=,#, or spaces, the resulting button URL will break unless youencodeURIComponent. - Meta enforces a 15-character limit on dynamic suffixes for some plans. Use a short slug (
a1b2c3) and resolve to the full URL on your server-side redirect. - Combine with Template — Image Header by adding
headerValues— same template can have an image AND a dynamic URL button.