send poll
#
Method#
/send-pollPOST
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/send-poll
#
HeaderKey | Value |
---|---|
Client-Token | ACCOUNT SECURITY TOKEN |
#
ConceptIn this method, you can send poll-type messages.
#
Attributes#
RequiredAttribute | Type | Description |
---|---|---|
phone | string | Recipient's phone number (or group ID for group sending) in the format DDI DDD NUMBER. Example: 551199999999. IMPORTANT: Send only numbers, without formatting or masks. |
message | string | Text to be sent in the poll |
poll | PollItem | List of poll options |
#
OptionalAttribute | Type | Description |
---|---|---|
delayMessage | number | In this attribute, a delay is added to the message. You can choose from a range of 1~15 seconds, which means how many seconds it will wait to send the next message. (Example: "delayMessage": 5). The default delay if not provided is 1~3 seconds. |
pollMaxOptions | number | Maximum number of votes per person in the poll |
#
PollItemAttribute | Type | Description |
---|---|---|
name | string | Option name |
#
Request Body#
Response#
200Attributes | Type | Description |
---|---|---|
zaapId | string | id on z-api |
messageId | string | id on whatsapp |
Example
#
405In this case certify that you are sending the correct specification of the method. This means, verify if you sent a POST or GET as specified at the beginning of this topic.
#
415In case you receive 415 error, make sure to add the “Content-Type” of the object you are sending in the request headers, mostly “application/json”
#
Webhook ResponseWebhook response link (upon receiving)