Yes, the Twilio API for WhatsApp supports two types of buttons for interactive message templates:
- Calls-to-action
- Quick replies
When creating a Template in the Twilio Console, you have the option to add either of these types of buttons to your Template. Once the template is submitted, all you need to do is send messages that match the message body of the Template. The buttons will be automatically added when the template is sent out.
For further details, see Using Buttons In WhatsApp.
Frequently Asked Questions
How can I configure my buttons?
Buttons need to be configured while creating your WhatsApp template in the WhatsApp Templates page in the Twilio Console. Under the Buttons section, you’ll have the option to add a "Call to Action" or "Quick Reply" button.
After a Template has been created, the button text/contents cannot be changed.
How do I get button responses?
When a users taps a button/quick reply, this automatically triggers a message that is sent to your business with the button text. If you have a webhook configured for incoming messages to your WhatsApp sender, then you will get the button text in the Body parameter as well as an additional ButtonText parameter, as described here.
Can I customize my buttons?
The Quick Reply button option gives you the ability to add up 3 custom button replies. The Call to Action button option lets you configure your button to call a number or visit a website when pressed. More information on these options can be found in our API documentation.
Please note, you can customize button contents when initially creating your Template, however it is not possible to dynamically change button text or functionality when sending messages using a specific Template.
What should I check if the buttons were not attached to the message?
If your message was received by the recipient, but no buttons were present, this typically means that the message you sent did not match your template.
Please check your message to make sure there were no typos or extra characters that may have resulted in a mismatch.
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.