How to use polls as buttons?
Creating polls as an alternative to interactive buttons in WhatsApp
Last updated
Creating polls as an alternative to interactive buttons in WhatsApp
Last updated
Interactive buttons in WhatsApp are a very handy tool for working with customers.
In our API, you have the option to send messages with buttons: Read more
However, sometimes buttons may not fit in your scenario. That's why we offer you a convenient alternative - use polls as buttons.
For the user, polls and interactive buttons are functionally similar. And the mechanism of working with a poll is very similar to that of buttons.
To work with surveys, you will need to use the POST /messages/poll method. You can find out more about it and test it here:
You will find ready-made code snippets in popular programming languages at the link.
Sending a poll is quite easy, you need a few parameters in the body of the request:
to
- in this parameter specify the Chat ID of the recipient (group, or personal number) to whom we send the survey. (Send only numbers, without formatting or masks).
title
- here specify the full message to the conversation partner, the text of your question.
options
- specify the user's response options. There can be from 2 to 12 of them.
count
- this parameter affects the amount of response options from the conversation partner. For example, several or only one answer from the whole survey.
Polls are of a customized type"type": "poll"
. At the same time, each option that can be voted for by the client also has its own identifier. For example:
Whereas when you vote, the webhook will receive full details of the selected option in the poll.
This way, you will be able to handle your customers' responses and respond appropriately. For example, responding with a pre-prepared answer.
We have prepared a simple and easy to understand source code for you to implement in your survey response integration or bot.
Remember, if you have any questions or issues along the way, our support team is always here to help. We value every user and strive to ensure that your experience with our API is as smooth and efficient as possible.