Skip to content

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.

  1. In the body of the request, in the message parameter, specify the full address to the interlocutor;
  2. In the optionName parameter put the options of the interlocutor's answer;
  3. The multipleAnswers parameter can be configured to allow multiple responses from the interlocutor. Or just one response from the entire poll;
  4. Send poll using sendPoll method;
  5. Tracking poll update messages in chat, message type typeMessage = pollUpdateMessage;
  6. 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:

Example of sending a poll