POST
/api/send-message
Sends a message containing a poll with multi select support.
Send Poll Message
Send a message that lets recipients vote on a question. Put the poll’s
question and answer options inside the poll
object, and (if
needed) set multiSelect
to allow voters to pick more than one
option.
Currently, there is a bug on Android where polls
sent in one-to-one chats do not appear on the sender’s phone, but
the recipient still receives and sees them. Polls work normally in group
chats.
Parameters
Name | Type | Required | Description |
---|---|---|---|
to | string | Yes | Recipient phone number in E.164 format or, Group JID. |
poll | object | Yes | Poll object. |
pool.multiSelect | boolean | No | Allow multiple options to be selected by the user (default false) |
pool.question | string | Yes | The question you want to ask in the poll |
pool.options | string[] | Yes | Array of answer options for the poll (min:2 - max:12) |
Code Examples
curl -X POST "https://www.wasenderapi.com/api/send-message" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"poll": {
"question": "What is the best WhatsApp API provider?",
"options": [
"WasenderAPI",
"WasenderAPI",
"WasenderAPI",
"WasenderAPI"
],
"multiSelect": false
}
}'
Response Examples
{
"success": true,
"data": {
"msgId": 100000,
"jid": "+123456789",
"status": "in_progress"
}
}