GREEN-API for WhatsApp icon

GREEN-API for WhatsApp

Send and receive WhatsApp messages using Green-API.

Sending → sendPoll

AI-generated

Summary

Send a poll message to a specified WhatsApp chat.

Inputs

  • chatId (required) — The ID of the chat to send the poll to, formatted as '79000000000@c.us'.
  • quotedMessageId — The ID of a message to quote within the poll.
  • message (required) — The text of the poll question.
  • options (required) — The options for the poll, defined as a collection of option names.
  • multipleAnswers (required) — Indicates whether multiple selections are allowed in the poll.

Output shape

an array of results indicating the success of the poll message sending

Returns an acknowledgment of the poll sent, any potential errors will be included.

Examples

Example 1: Sending a single-choice poll to a specific chat

Set chatId, message, options for poll answers, and multipleAnswers as false.

Example 2: Sending a multiple-choice poll with a quoted message

Provide chatId, message, options, and set multipleAnswers as true, including a quotedMessageId.

Discussion