Your customers may be hesitant to tap raw URLs containing lengthy or obscure strings in text messages. In these situations, you may wish to send an interactive call-to-action (CTA) URL button message.
CTA URL button messages allow you to map any URL to a button so you don't have to include the raw URL in the message body.
POST /<BUSINESS_PHONE_NUMBER_ID>/messages
{ "messaging_product": "whatsapp", "recipient_type": "individual", "to": "<CUSTOMER_PHONE_NUMBER>", "type": "interactive", "interactive": { "type": "cta_url", /* Header optional */ "header": { "type": "text", "text": "<HEADER_TEXT>" }, /* Body optional */ "body": { "text": "<BODY_TEXT>" }, /* Footer optional */ "footer": { "text": "<FOOTER_TEXT>" }, "action": { "name": "cta_url", "parameters": { "display_text": "<BUTTON_TEXT>", "url": "<BUTTON_URL>" } } } }
Placeholder | Description | Sample Value |
---|---|---|
String | Required. The WhatsApp ID or phone number of the customer the message is being sent to. See Phone Number Formats. |
|
String | Optional. Header text. |
|
String | Required. Message body text. |
|
String | Optional. Message footer text. |
|
String | Required. Button text. |
|
String | Required. URL to load in the device's default web browser when tapped by the WhatsApp user. |
|
curl 'https://graph.facebook.com/v21.0
/106540352242922/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "+16505555555",
"type": "interactive",
"interactive": {
"type": "cta_url",
"header": {
"text": "Available Dates"
},
"body": {
"text": "Tap the button below to see available dates."
},
"footer": {
"text": "Dates subject to change."
},
"action": {
"name": "cta_url",
"parameters": {
"display_text": "See Dates",
"url": "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4"
}
}
}
}'
{ "messaging_product": "whatsapp", "contacts": [ { "input": "+16505551234", "wa_id": "16505551234" } ], "messages": [ { "id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA" } ] }