संदेश

Send poll

POST
/messages/poll

Votes arrive through the poll.vote webhook, with the message_id from this response.

ऑथराइज़ेशन

X-Api-Key: wpf_YOUR_KEY

The connection's API key (wpf_...), generated in the dashboard.

Authorization: Bearer wpf_YOUR_KEY

The same key in Authorization: Bearer wpf_... (what n8n, Make and HTTP libraries support out of the box).

हेडर पैरामीटर

Idempotency-Key?string

Optional. Repeating the same value within 24 h, with the same API key, returns the first response without sending again. See Idempotency in the introduction.

अनुरोध की बॉडी

application/json
  1. body
to*string

Recipient: phone number with country code and area code, digits only (5581999999999; +, spaces and dashes are ignored), or the chatId (5581999999999@c.us, ...@lid, or a group ...@g.us). Brazilian phone numbers are checked on WhatsApp before sending.

name*string

The poll question.

options*array<>

The options, 2 to 12, all distinct.

आइटम2 <= items <= 12
multiple_answers?boolean

Optional: true allows selecting more than one option. Default false.

रिस्पॉन्स बॉडी

Sent. Keep the message_id: it is what appears in the message.sent and message.status events.

application/json
  1. response
data*
curl -X POST 'https://app.wappfy.io/api/v1/messages/poll' \  -H 'X-Api-Key: wpf_YOUR_KEY' \  -H 'Content-Type: application/json' \  -d '{  "to": "5581999999999",  "name": "Qual horário prefere?",  "options": [    "Manhã",    "Tarde",    "Noite"  ],  "multiple_answers": false}'
{  "data": {    "message_id": "string",    "chat_id": "string"  }}