Get votes from polls in the Channel
Polls in the channel (newsletter) are a very handy feature, but there are pitfalls here
Last updated
Polls in the channel (newsletter) are a very handy feature, but there are pitfalls here
Last updated
We already know how to send messages to WhatsApp channels, and itโs incredibly convenient โ our API lets you fully automate channel management: receiving messages, tracking changes, sending messages, and managing administrators.
Unlike other messaging features, WhatsApp Channels donโt show subscriber details. This means you canโt see who voted in a poll or reacted to a post. In this article, weโll cover the special approach needed to get poll vote information from a channel and walk you through the process step by step.
Unfortunately, WhatsApp doesn't provide this information directly, so we had to implement additional operations to enable receiving callbacks for the โvoted in pollโ event.
Before you can start receiving poll information from a channel, you need to subscribe to channel updates. This is done through a system endpoint, which allows you to receive poll-related callbacks.
To subscribe, use the POST method with the following endpoint: https://gate.whapi.cloud/newsletters/{NewsletterID}/tracking
Make sure to specify the channel ID. Once this is completed and you receive a successful response, you will begin receiving poll vote data via your webhook.
Please note that there may be a delay of about 10-20 seconds in receiving these callbacks. The delay is not due to our API - that's how WhatsApp receives and updates information on its side.
Additionally, you can only follow one channel at a time. If you are managing multiple channels, this method will not apply to all of them at once. You will only monitor the last channel you have set up tracking.
To get a callback with this information, enable Messages PATCH
mode in your webhook settings. Example of an incoming callback about a poll vote:
If you want to get vote information via HTTP request, you will also need to be subscribed for updates on the channel.
Use the GET endpoint https://gate.whapi.cloud/newsletters/{NewsletterID}/messages
to retrieve all messages from the WhatsApp channel. Find your poll in the reponse and you will see the amount of votes in the poll.
Warning. Get this information via GET https://gate.whapi.cloud/messages/{MessageID} unfortunately will not work. This is due to the nature of getting votes from a poll in a channel, where we perform additional operations that do not affect the Messages section.
We continue to explore WhatsApp's capabilities and add to our methods for automation.
If you have any questions, our team is always available to help you.