SparkBot icon

SparkBot

Interact with SparkBot WhatsApp API

Actions148

Overview

This node integrates with the SparkBot WhatsApp API to manage WhatsApp chats. Specifically, the "Unassign Chat" operation under the "Chats" resource allows users to unassign a chat from an agent or user. This is useful in scenarios where a chat needs to be released from an assigned agent for reassignment, closure, or other workflow purposes.

Practical examples include:

  • Automatically unassigning a chat when a support ticket is closed.
  • Releasing chats from agents who are going offline or unavailable.
  • Managing workload distribution by unassigning chats before reassigning them to other agents.

Properties

Name Meaning
WhatsApp Number The ID of the WhatsApp number (device) from which the chat originates.
Chat ID The unique identifier of the chat to unassign. Examples: 447362053576@c.us for a user chat, 44736205357600000000@g.us for a group chat.

Output

The output JSON contains the response from the SparkBot API after attempting to unassign the specified chat. It typically includes confirmation of the unassignment or details about the updated chat status.

If the operation fails and "Continue On Fail" is enabled, the output will contain an error object with a message describing the failure.

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 API being accessible and properly configured.
  • The "WhatsApp Number" must be registered and active within the SparkBot system.
  • Proper permissions to modify chat assignments are necessary.

Troubleshooting

  • Common Issues:

    • Invalid or missing WhatsApp Number or Chat ID parameters.
    • Insufficient permissions to unassign chats.
    • Network or authentication errors connecting to the SparkBot API.
    • Attempting to unassign a chat that is not currently assigned.
  • Error Messages:

    • "error": "Chat not found" β€” Verify the Chat ID is correct and exists.
    • "error": "Unauthorized" β€” Check API key validity and permissions.
    • "error": "Invalid device" β€” Confirm the WhatsApp Number is valid and active.
  • Resolutions:

    • Double-check input parameters for correctness.
    • Ensure the API key credential is correctly set up and has required scopes.
    • Verify network connectivity and API endpoint availability.
    • Use the node's "Continue On Fail" option to handle errors gracefully in workflows.

Links and References

Discussion