WasenderApi - Low Cost WhatsApp API for Developers How to Use Polls as Buttons in WhatsApp - Help Center - WasenderApi - Low Cost WhatsApp API for Developers

How to Use Polls as Buttons in WhatsApp

How to Use Polls as Buttons in WhatsApp

WhatsApp interactive buttons are a great way to engage users, but sometimes you need more flexibility or want to offer multiple selectable options. In WasenderApi, you can use polls as an alternative to buttons for interactive customer experiences.

Sending a Poll

To send a poll, use the POST /api/send-message endpoint. The poll object should include:

  • question: The poll question you want to ask.
  • options: An array of answer options (2 to 12).
  • multiSelect (optional): Set to true to allow users to select more than one option (default is false).
{
  "to": "+1234567890",
  "poll": {
    "question": "What is the best WhatsApp API provider?",
    "options": [
      "WasenderAPI",
      "Option 2",
      "Option 3"
    ],
    "multiSelect": false
  }
}

Note: There is a known issue on Android where polls sent in one-to-one chats may not appear on the sender’s phone, but the recipient will still receive and see them. Polls work normally in group chats.

For more details and the latest updates, see the official WasenderApi documentation.

Tracking Poll Responses

When a user votes in a poll, your webhook will receive a payload like this:

{
  "event": "poll.results",
  "sessionId": "YOUR_SESSION_ID",
  "data": {
    "key": {
      "remoteJid": "WHATSAPP_JID",
      "fromMe": true,
      "id": "MESSAGE_ID"
    },
    "pollResult": [
      {
        "name": "yes",
        "voters": []
      },
      {
        "name": "no",
        "voters": [
          "[email protected]"
        ]
      }
    ]
  },
  "timestamp": 1753277070225
}

Each object in pollResult represents an option, with a name and a voters array containing the WhatsApp IDs of users who selected that option.

You can use this data to trigger automated replies or handle user choices programmatically.

Best Practices

  • Use polls when you want to offer multiple choices or need more than the standard button limit.
  • Set multiSelect to false for single-choice (button-like) behavior, or true for multi-select polls.
  • Always handle poll responses in your webhook to provide a seamless user experience.
  • For more details, check the API documentation or contact support if you need help with advanced poll logic.

Still Need Help?

Can't find what you're looking for? Our support team is here to help.