Green API icon

Green API

Send WhatsApp messages via Green API

Overview

This node enables sending WhatsApp poll messages via the Green API service. It allows users to create interactive polls within WhatsApp chats, where recipients can vote on predefined options. This is useful for gathering opinions, making group decisions, or conducting quick surveys directly in chat conversations.

Practical examples include:

  • Sending a poll to a team chat to decide on a meeting time.
  • Creating a customer feedback poll in a support chat.
  • Running informal votes in social or community groups.

Properties

Name Meaning
Chat ID Identifier of the chat to send the poll to. For private chats use phone@c.us, for groups use chatId@g.us.
Message The text message that introduces or describes the poll.
Poll Options Comma-separated list of poll options (between 2 and 12). Each option represents a choice users can select.
Multiple Answers Boolean flag indicating whether the poll allows multiple answers per participant (true) or only one answer (false).
Quoted Message ID Optional ID of a message to quote when sending the poll, providing context or reference.

Output

The node outputs an array of JSON objects representing the response from the Green API after sending the poll. The exact structure depends on the API but typically includes confirmation details such as message IDs, status, and timestamps.

No binary data output is involved in this operation.

Dependencies

  • Requires an active Green API account with valid credentials: an instance identifier and an API token.
  • The node makes HTTP POST requests to the Green API endpoints to perform actions.
  • Proper configuration of these credentials in n8n is necessary for authentication.

Troubleshooting

  • Common issues:
    • Invalid or missing chat ID format may cause failures.
    • Providing fewer than 2 or more than 12 poll options will likely result in errors.
    • Network or authentication errors if API credentials are incorrect or expired.
  • Error messages:
    • "Failed to send poll: [error message]" indicates an issue during the API request. Check the error details and verify the payload.
    • Errors related to reading or formatting input parameters suggest invalid inputs.
  • Resolutions:
    • Ensure chat IDs follow the required format.
    • Validate poll options count and formatting.
    • Confirm API credentials are correctly set up and have necessary permissions.
    • Review the detailed error message and the data sent for debugging.

Links and References

Discussion