Yes, the Twilio API for WhatsApp supports three types of buttons for interactive message templates via the Content Template Builder:
- Call To Action
- Quick replies
- Copy Code
When creating a Template in the Content Template Builder, you have the option to create different Content Types which contain buttons. New and updated features are sometimes available via API before they are available in the Content Template Builder UI, see below for features currently supported in each platform.
Available in Content Template Builder UI and API:
-
Card:
- CTA OR Quick Reply with Media and/or Footer
- Up to 3 Quick Reply buttons
- 1 URL and 1 Phone CTA buttons
-
WhatsApp Card:
- CTA OR Quick Reply with Media or Text Header and/or Footer
- Up to 3 Quick Reply buttons
- 1 URL and 1 Phone CTA buttons
-
Quick Reply:
- Up to 3 buttons
-
Call To Action:
- 1 URL and 1 Phone CTA buttons
-
WhatsApp Authentication:
- Copy Code
Available in API only:
-
Card:
- CTA AND Quick Reply with Media and/or Footer
- Up to 5 Quick Reply buttons
- 2 URL and 1 Phone CTA buttons
- Copy Code
-
WhatsApp Card:
- CTA AND Quick Reply with Media or Text Header and/or Footer
- Up to 5 Quick Reply buttons
- 2 URL and 1 Phone CTA buttons
- Copy Code
-
Quick Reply:
- Up to 5 buttons
-
Call To Action:
- 2 URL and 1 Phone CTA buttons
- Copy Code
-
Carousel:
- CTA AND Quick Reply
Once the template is submitted, you can send the message using the Content SID and Content Variables. See our Content Template docs for more details on how to send a Content Template.
Frequently Asked Questions
How can I configure my buttons?
Buttons need to be configured while creating your WhatsApp template in the Content Template Builder or via Content API. See here for how to create the different Content Types mentioned above.
How do I get button responses?
When a user taps a quick reply button, this automatically triggers a reply message with the text configured on the button.
If you have a webhook configured for incoming messages to your WhatsApp sender, you will receive the button text in the "Body" and "ButtonText" parameters. Quick Replies also let you configure a button ID that is not visible to the end user. This ID will be returned in the "ButtonPayload" parameter of the incoming webhook payload.
Can I customize my buttons?
Content Templates can contain up to three Quick Reply buttons when created in the Content Template Builder UI and five buttons when created via Content API. These buttons can be configured to use dynamic variables.
Content Templates can contain up to two Call to Action buttons when created in the Content Template Builder UI, one to call a number and another to visit a website when pressed. When created via the Content API, they can contain up to three Call to Action buttons, two to visit a website and one to call a number. These buttons can also use dynamic variables.
Variables are not supported in Copy Code buttons. Authentication Type Templates must contain a Copy Code button. The text can be edited on template creation.
What should I check if the buttons were not attached to the message?
This usually happens if you are using templates created in the "WhatsApp Templates" section of the console and the message you sent did not match your template. It is recommended to use templates created in Content Template Builder or via Content API. These templates are matched based on Content SID and do not risk a template mismatch error.
When a user clicks a Call To Action, does anything show up in my Messaging logs, or in a callback to my webhook?
No, since the Call-to-Action button only initiates a phone call or loads a website, it does not result in any message or webhook callback.
When a user clicks a Call To Action to call a number, does the call take place over WhatsApp?
No, the number will be loaded into the phone's native dialer app to be made as a standard voice call.
My template with a Call To Action is not getting registered with WhatsApp, what's going on?
If you are using the Call To Action functionality on your template, and you are trying to include a link to WhatsApp itself (e.g. a whatsapp.me link that will act as a shortcut to start another WhatsApp conversation) that is not allowed by WhatsApp and will result in templates failing to register.
Do I need WhatsApp approval to send templates with buttons?
Quick Replies and templates containing only Call To Action buttons with URLs can be used in session without being approved by WhatsApp (just click “Save” instead of “Save and submit to WhatsApp” in the console or omit the API call to submit the template to WhatsApp), however in order to start conversations they do need to be approved. See here for what Content Types need approval or not.