SparkBot icon

SparkBot

Interact with SparkBot WhatsApp API

Actions148

Overview

This node interacts with the SparkBot WhatsApp API to manage chat statuses for WhatsApp numbers. Specifically, the "Set Chat Status" operation allows users to update the internal status of a particular chat associated with a WhatsApp number. This is useful in customer support or sales scenarios where chats need to be tracked by their lifecycle stage, such as marking conversations as active, pending, resolved, archived, or removed.

Practical examples include:

  • Marking a customer support chat as "resolved" after the issue is addressed.
  • Archiving old chats to keep the active chat list clean.
  • Setting a chat to "pending" when awaiting customer response.

Properties

Name Meaning
WhatsApp Number The ID of the WhatsApp number (device) from which the chat belongs. Loaded dynamically via available devices.
Chat ID The unique identifier of the chat to update. Examples: 447362053576@c.us for individual user chats, 44736205357600000000@g.us for group chats.
Status The new internal status to assign to the chat. Options are: Active, Pending, Resolved, Archived, Removed.

Output

The node outputs a JSON object representing the result of the status update operation. This typically includes confirmation details about the updated chat status. The exact structure depends on the SparkBot API response but generally confirms success or provides error information.

No binary data output is involved in this operation.

Dependencies

  • Requires an API key credential for authenticating with the SparkBot WhatsApp API.
  • The node depends on the SparkBot service being accessible and properly configured.
  • The "WhatsApp Number" property dynamically loads available devices via an internal method, so the user must have at least one registered WhatsApp number/device linked to their account.

Troubleshooting

  • Common issues:

    • Invalid or missing Chat ID: Ensure the Chat ID is correctly formatted and corresponds to an existing chat.
    • Unauthorized errors: Verify that the API key credential is valid and has sufficient permissions.
    • Network or API downtime: Check connectivity and SparkBot service status.
  • Error messages:

    • "Chat not found": The specified Chat ID does not exist or is not accessible under the given WhatsApp number.
    • "Invalid status value": The status provided is not one of the allowed options.
    • "Authentication failed": The API key credential is invalid or expired.

Resolving these usually involves verifying input parameters, refreshing credentials, and ensuring the SparkBot API is operational.

Links and References

Discussion