Recommendations for handling polls via incoming notifications#
Poll update events are being formed in a pollUpdateMessage type notification.
This notification returns poll actions broken down by a single user.
A comprehensive view of the poll state requires aggregating data from all webhooks.
Examples of webhooks triggered by poll updates:#
Selection of a single answer option (account 1):#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 1234567890,
"wid": "71234567890@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1756439417,
"idMessage": "3A93672A6E64A1669387",
"senderData": {
"chatId": "120363403814479258@g.us",
"chatName": "name",
"sender": "79876543210@c.us",
"senderName": "name",
"senderContactName": ""
},
"messageData": {
"typeMessage": "pollUpdateMessage",
"pollMessageData": {
"stanzaId": "BAE59896B404EB11",
"name": "bebebe",
"votes": [
{
"optionName": "bebe!",
"optionVoters": [
"79876543210@c.us"
]
},
{
"optionName": "bebe?",
"optionVoters": []
},
{
"optionName": "bebe.",
"optionVoters": []
}
],
"multipleAnswers": false
}
}
}
Selection of a single answer option (account 2):#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 1234567890,
"wid": "71234567890@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1756439432,
"idMessage": "74FFFB71C24FD2A6BC9B11DE7B23806C",
"senderData": {
"chatId": "120363403814479258@g.us",
"chatName": "name",
"sender": "79998765432@c.us",
"senderName": "name",
"senderContactName": ""
},
"messageData": {
"typeMessage": "pollUpdateMessage",
"pollMessageData": {
"stanzaId": "BAE59896B404EB11",
"name": "bebebe",
"votes": [
{
"optionName": "bebe!",
"optionVoters": []
},
{
"optionName": "bebe?",
"optionVoters": [
"79998765432@c.us"
]
},
{
"optionName": "bebe.",
"optionVoters": []
}
],
"multipleAnswers": false
}
}
}
Answer selection canceled (account 2):#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 1234567890,
"wid": "71234567890@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1756439831,
"idMessage": "60D0A3349B03DCDAD6899B8D2D305CBB",
"senderData": {
"chatId": "120363403814479258@g.us",
"chatName": "name",
"sender": "79998765432@c.us",
"senderName": "name",
"senderContactName": ""
},
"messageData": {
"typeMessage": "pollUpdateMessage",
"pollMessageData": {
"stanzaId": "BAE59896B404EB11",
"name": "bebebe",
"votes": [
{
"optionName": "bebe!",
"optionVoters": []
},
{
"optionName": "bebe?",
"optionVoters": []
},
{
"optionName": "bebe.",
"optionVoters": []
}
],
"multipleAnswers": false
}
}
}
Selection of a single answer option (account 3):#
{
"typeWebhook": "incomingMessageReceived",
"instanceData": {
"idInstance": 1234567890,
"wid": "71234567890@c.us",
"typeInstance": "whatsapp"
},
"timestamp": 1756439716,
"idMessage": "3F7F71A4165ACE0EA60A",
"senderData": {
"chatId": "120363403814479258@g.us",
"chatName": "name",
"sender": "77123456789@c.us",
"senderName": "name",
"senderContactName": ""
},
"messageData": {
"typeMessage": "pollUpdateMessage",
"pollMessageData": {
"stanzaId": "BAE59896B404EB11",
"name": "bebebe",
"votes": [
{
"optionName": "bebe!",
"optionVoters": []
},
{
"optionName": "bebe?",
"optionVoters": []
},
{
"optionName": "bebe.",
"optionVoters": [
"77123456789@c.us"
]
}
],
"multipleAnswers": false
}
}
}
Sample result of poll notification processing:#
After processing data from all notifications, the poll options should look as follows:
"votes": [
{
"optionName": "bebe!",
"optionVoters": [
"79876543210@c.us"
]
},
{
"optionName": "bebe?",
"optionVoters": []
},
{
"optionName": "bebe.",
"optionVoters": [
"77123456789@c.us"
]
}
]