Menu

Expand
Rate this page:

twilio/call-to-action

Twilio/call-to-action buttons let recipients tap to trigger actions such as launching a website or making a phone call.

Call-to-action buttons can only be sent via WhatsApp as approved templates.

If you are using a URL button and want to submit the template for WhatsApp approval, the URL must resolve to a publicly accessible website. If there is a variable, a valid path sample should be included in the variables array. The combined URL should resolve to a publicly accessible website.

Example:

"url": ["https://www.twilio.com/{{1}}"] would include a path sample in the variables definition."variables": {"1": "docs"}

Twilio/call-to-action templates can be sent via Whatsapp for out of session messages with variables. If the template's body starts or ends with a variable or has two variables next to each other, the template will not be approved by Whatsapp without a sample variable. For additional information about variables see Using Variables with Content Templates.

Supported Channels

WhatsApp, Facebook Messenger

Message Preview

Content Api - CTA preview

Data Parameters

body:

Type - string

Required - yes

Variable Support - yes

Description - The text of the message you want to send. This is included as a regular text message.

  • Maximum 640 characters

actions:

Type - array[actions]

Required - yes

Variable Support - See Common Components: Actions definition

Description - Buttons that recipients can tap on to act on the message:

  • Up to 2 buttons for Call-to-Action button types: PHONE_NUMBER or URL. Please note only a single PHONE_NUMBER or URL button can be used at a time. If two buttons are used, one must be a URL and the other a PHONE_NUMBER.
  • Please use “type” and “title” actions to create call-to-action buttons within the actions array.
Loading Code Sample...
        
        

        Create Call-To-Action Template

        Rate this page:

        Need some help?

        We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

        Loading Code Sample...
              
              
              

              Thank you for your feedback!

              Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

              Sending your feedback...
              🎉 Thank you for your feedback!
              Something went wrong. Please try again.

              Thanks for your feedback!

              thanks-feedback-gif