How to use polls as buttons?#
To facilitate communication with your customer, you can send a poll to your customer. In this way, the customer clicking on a selection item will be able to give feedback without sending a message to the chat.
The poll mechanism is very similar to the button mechanism.
- In the body of the request, in the
message
parameter, specify the full address to the interlocutor; - In the
optionName
parameter put the options of the interlocutor's answer; - The
multipleAnswers
parameter can be configured to allow multiple responses from the interlocutor. Or just one response from the entire poll; - Send poll using sendPoll method;
- Tracking poll update messages in chat, message type
typeMessage = pollUpdateMessage
; - Checking the selection item by poll, tracking the
stanzaId
field - the poll by which the user's selection came.
Here is an example of sending a message to a client:
