SparkBot icon

SparkBot

Interact with SparkBot WhatsApp API

Actions148

Overview

The "Sync Device Chats" operation under the "Chats" resource in this node allows users to synchronize recent chat conversations from a specified WhatsApp device number. This operation fetches a limited number of recent chats along with a capped number of messages per chat, enabling users to keep their workflow updated with the latest conversation data from that WhatsApp account.

This is particularly useful for scenarios such as:

  • Importing recent chat history into a CRM or helpdesk system.
  • Monitoring customer interactions on WhatsApp for analytics or reporting.
  • Automating follow-ups based on recent message content.
  • Archiving recent conversations for compliance or backup purposes.

For example, a user could sync the last 50 chats from a specific WhatsApp number and retrieve up to 50 messages per chat to analyze customer sentiment or trigger automated responses.

Properties

Name Meaning
WhatsApp Number (device) The ID of the WhatsApp number/device from which to sync chats.
Maximum Chats (size) The maximum number of recent chats to synchronize (e.g., 50).
Maximum Messages Per Chat (messages) The maximum number of messages to retrieve per chat during synchronization (e.g., 50).

Output

The output JSON contains the synchronized chat data from the specified WhatsApp device. Each item typically includes details about individual chats and their messages, structured to represent conversations fetched from the device.

If binary data is involved (not explicitly shown here), it would generally represent media files or attachments related to chats, but this operation focuses on chat and message data.

Dependencies

  • Requires an API key credential for authenticating with the SparkBot WhatsApp API service.
  • The node depends on the external SparkBot WhatsApp API to fetch chat and message data.
  • Proper configuration of the API key credential within n8n is necessary.
  • The "WhatsApp Number" must be a valid registered device ID accessible via the API.

Troubleshooting

  • Common Issues:

    • Invalid or expired API key leading to authentication failures.
    • Specifying a WhatsApp number/device ID that does not exist or is not linked to the API account.
    • Requesting too many chats or messages exceeding API limits, causing timeouts or errors.
  • Error Messages:

    • Authentication errors: Check that the API key credential is correctly set and has proper permissions.
    • Not found errors for the device: Verify the WhatsApp number/device ID is correct and active.
    • Rate limit or quota exceeded: Reduce the "Maximum Chats" or "Maximum Messages Per Chat" values.
  • Resolution Tips:

    • Ensure the API key is valid and has access to the target WhatsApp device.
    • Use the "WhatsApp Number" dropdown to select from available devices to avoid typos.
    • Adjust limits to smaller numbers if encountering performance issues.

Links and References


Note: The above summary is based solely on static analysis of the provided source code and property definitions.

Discussion