SparkBot icon

SparkBot

Interact with SparkBot WhatsApp API

Actions148

Overview

This node sends a poll message via WhatsApp using the SparkBot API. It allows users to create interactive polls within WhatsApp chats, groups, or channels by specifying a question and multiple answer options. This is useful for gathering quick feedback, conducting surveys, or engaging audiences in group discussions.

Common scenarios:

  • Conducting customer satisfaction surveys directly in WhatsApp.
  • Running quick opinion polls in group chats or broadcast channels.
  • Collecting votes or preferences from team members or customers.

Example:
A marketing team wants to ask their WhatsApp subscribers which new product feature they prefer. They use this node to send a poll with options like "Feature A", "Feature B", and "Feature C" to a broadcast channel.


Properties

Name Meaning
WhatsApp number The SparkBot Number ID used to send the poll message. This identifies the WhatsApp number/account sending the message.
Target Type of target chat where the poll will be sent. Options: Phone (individual phone number), Group (WhatsApp group chat), Channel (broadcast/newsletter channel).
Phone Number Target phone number in international E.164 format (e.g., +1234567890). Required if Target is Phone.
Group ID ID of the target WhatsApp group chat (e.g., 12345678902401234@g.us). Required if Target is Group.
Channel ID ID of the target broadcast channel (e.g., 12345678902402200@newsletter). Required if Target is Channel.
Poll Question The question or title text for the poll.
Poll Options List of poll answer options. Minimum 2, maximum 10 options allowed. Each option is a string up to 100 characters.
Options Additional message options including:
- Priority: Normal, High, Low
- Label: Custom label to categorize the message
- Reference ID: Custom reference for tracking
- Team Agent: Send on behalf of an agent
- Live mode: Real-time sending without queue
- Delivery Queue Mode: Default, Always Queue, Never Queue, Opportunistic
- Maximum Retries: Number of delivery retries
- Chat Actions: Post-delivery actions such as assigning chat, resolving, adding/removing labels or metadata
Message Expiration Time-to-live (TTL) for the message. Can specify expiration in seconds, duration (e.g., 1h, 30m), or specific date/time.
Mark Chat as Read Whether to notify WhatsApp that previous unread messages are read after sending this message (blue double-check).
Typing simulation Seconds to simulate typing or recording status before sending the message (0 disables). Range 2-30 seconds.
Quote Message Message ID to quote when sending the poll (must be in the same conversation).
Strict Message Order Ensures messages are sent in strict order to the chat. Useful for chatbots or sequences. Not compatible with live mode or never queue delivery.

Output

The node outputs JSON data representing the result of the poll message sending operation. This typically includes:

  • Confirmation of successful message dispatch.
  • Metadata about the sent poll message (e.g., message ID, timestamp).
  • Any error information if the sending failed.

No binary data output is expected from this node.


Dependencies

  • Requires an active SparkBot WhatsApp API account with a valid API key credential configured in n8n.
  • The node depends on SparkBot's backend services for sending WhatsApp messages and managing chats.
  • Proper configuration of devices (WhatsApp numbers), groups, and channels in SparkBot is necessary.
  • Network connectivity to SparkBot API endpoints is required.

Troubleshooting

  • Invalid phone number format: Ensure phone numbers are in E.164 format (e.g., +1234567890). The node validates this and will throw an error if invalid.
  • Missing required fields: Poll question and at least two poll options must be provided.
  • Target selection mismatch: If Target is set to phone, ensure Phone Number is filled; if group, Group ID must be selected; if channel, Channel ID must be selected.
  • Delivery failures: Using real-time mode (live) with high message volume may cause bans or delivery issues. Use queue modes appropriately.
  • Agent or department IDs: When assigning chats post-message, ensure valid 24-character hexadecimal IDs are used.
  • Message quoting errors: Quoted message IDs must be valid and belong to the same conversation.
  • Strict order conflicts: Enabling strict message order is incompatible with live mode or never queue delivery options.

If errors occur, check the error messages returned in the node output JSON for guidance.


Links and References

Discussion