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
- OTP Copy Code
When creating a Template in the Content Template Builder, you have the option to create different Content Types which contain buttons:
- Card - Call To Action OR Quick Reply with Media and/or Footer
- WhatsApp Card - Call To Action OR Quick Reply with Media or Text Header and/or Footer
- Quick Reply
- Call To Action
- WhatsApp Authentication - Copy Code
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. 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. These buttons can be edited on template creation and can also be configured to use dynamic variables.
Content Templates can contain up to two Call to Action buttons, one to call a number and another to visit a website when pressed. These buttons can also use dynamic variables.
Authentication Type Templates must contain a Copy Code button. The text can be edited on template creation. Variables are not supported for these buttons.
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. 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.