Skip to content

Incoming poll update message#

This section describes messageData object incoming webhook format for incoming poll update message. For a description of the general format of incoming webhooks, refer to Incoming Messages section.

To get incoming webhooks of this type, two conditions must be true:

typeWebhook = incomingMessageReceived

messageData.typeMessage = pollUpdateMessage

Webhook#

Webhook parameters#

messageData object parameters

Parameter Type Description
typeMessage string Incoming message type. For messages of this type the parameter takes on the value pollUpdateMessage.
pollMessageData object Poll message data object

pollMessageData object parameters

Parameter Type Description
stanzaId string Poll message id
name string Poll name
votes array Array of poll options
multipleAnswers boolean Allow multiple answers. true - enabled, false - disabled, default: false

votes array parameters

Parameter Type Description
optionName string Option name
optionVoters array Array of wid users who selected the option

optionVoters array parameters

Parameter Type Description
default string wid user who selected the option

Webhook body example#

{
  "typeWebhook": "incomingMessageReceived",
  "instanceData": {
    "idInstance": 1234,
    "wid": "11001234567@c.us",
    "typeInstance": "whatsapp"
  },
  "timestamp": 1588091580,
  "idMessage": "F7AEC1B7086ECDC7E6E45923F5EDB825",
  "senderData": {
    "chatId": "79001234568@c.us",
    "sender": "79001234568@c.us",
      "chatName": "John",
    "senderName": "John",
    "senderContactName": "John Doe"
  },
  "messageData": {
    "typeMessage": "pollUpdateMessage",
    "pollMessageData": {
      "stanzaId": "BAE53AFDD5F0C000",
      "name": "Poll Name",
      "votes": [
        {
          "optionName": "Variant 1",
          "optionVoters": []
        },
        {
          "optionName": "Variant 2",
          "optionVoters": ["79001234568@c.us"]
        }
      ],
      "multipleAnswers": false
    }
  }
}