Interactive Call-to-Action URL Button Messages

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.

Sending CTA URL Button Messages

Request Syntax

POST /<BUSINESS_PHONE_NUMBER_ID>/messages

Post Body

{
  "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>"
      }
    }
  }
}

Post Body Parameters

PlaceholderDescriptionSample Value

<CUSTOMER_PHONE_NUMBER>

String

Required.


The WhatsApp ID or phone number of the customer the message is being sent to. See Phone Number Formats.

+15558543153

<HEADER_TEXT>

String

Optional.


Header text.

Available Dates

<BODY_TEXT>

String

Required.


Message body text.

Tap the button below to see available dates.

<FOOTER_TEXT>

String

Optional.


Message footer text.

Dates subject to change.

<BUTTON_TEXT>

String

Required.


Button text.

See Dates

<BUTTON_URL>

String

Required.


URL to load in the device's default web browser when tapped by the WhatsApp user.

https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4

Example Request

curl 'https://graph.facebook.com/v20.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"
            }
        }
    }
}'

Example Response

{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "+16505551234",
      "wa_id": "16505551234"
    }
  ],
  "messages": [
    {
      "id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
    }
  ]
}