SparkBot icon

SparkBot

Interact with SparkBot WhatsApp API

Actions148

Overview

This node interacts with the SparkBot WhatsApp API to retrieve participants of a WhatsApp group chat. It is useful for scenarios where you need to manage or analyze group membership, such as filtering participants by role (admin, owner, participant), searching for specific members, or paginating through large groups.

Practical examples include:

  • Extracting all admins from a group to send targeted messages.
  • Filtering participants who are saved contacts in your WhatsApp agenda.
  • Paginating through group members to display them in batches in an external system.

Properties

Name Meaning
WhatsApp Number The ID of the WhatsApp number (device) to use for the operation. This identifies which WhatsApp account to query.
Chat ID The unique identifier of the chat group (e.g., 44736205357600000000@g.us for a group).
Filters Collection of filters to narrow down the participants returned:
- Search Search participants by name, phone number, or WhatsApp ID.
- Phone Numbers Filter participants by one or more phone numbers.
- Role Filter participants by their role in the group. Options: Admin, Owner, Participant.
- Only Contacts Boolean flag to filter only participants that are contacts saved in the WhatsApp agenda.
- Include Contact Info Optionally include detailed contact information for each participant if available. Currently supports including "Contact" info.
- Results Page Size Maximum number of results to return per page (pagination size).
- Page Number Page number to retrieve, starting from 0 (for pagination).

Output

The node outputs a JSON array containing the filtered list of group participants. Each participant object typically includes identifiers and metadata such as:

  • Participant's WhatsApp ID
  • Role in the group (admin, owner, participant)
  • Contact information if requested and available (e.g., name, phone number)

If the "Include Contact Info" option is selected, additional contact details are included in the output.

The node does not output binary data.

Dependencies

  • Requires an active connection to the SparkBot WhatsApp API.
  • Requires an API key credential configured in n8n to authenticate requests.
  • The WhatsApp number (device) must be registered and linked to the SparkBot service.

Troubleshooting

  • Common issues:

    • Invalid or missing WhatsApp number/device ID: Ensure the device ID corresponds to a valid WhatsApp number registered in SparkBot.
    • Incorrect Chat ID format: Group chat IDs should end with @g.us. User chats have different formats and will not work for this operation.
    • Pagination parameters out of range: Ensure page number and size are within valid limits.
    • No participants returned: Check filters; overly restrictive filters may result in empty results.
  • Error messages:

    • Authentication errors: Verify that the API key credential is correctly set up and has necessary permissions.
    • Network or API errors: Confirm network connectivity and that the SparkBot API endpoint is reachable.
    • Parameter validation errors: Double-check required fields like Chat ID and WhatsApp Number are provided and correctly formatted.

Links and References

Discussion