Actions148
- Chats Actions
- Chat Contacts Actions
- Chat Messages Actions
- Chat Files Actions
- Files Actions
- Team Actions
- Labels Actions
- Departments Actions
- Quick replies Actions
- Queue Actions
- WhatsApp session Actions
- WhatsApp profile Actions
- Business catalog Actions
- Campaigns Actions
- Meeting Links Actions
- User Status Actions
- Webhooks Actions
- Other Actions
- Send messages Actions
- Outbound Messages Actions
- WhatsApp Numbers Actions
- Groups Actions
- Channels Actions
Overview
The node integrates with the SparkBot WhatsApp API to synchronize chat messages from a specified WhatsApp number and chat. It allows users to fetch recent messages in a chat, supporting pagination and limiting the number of messages retrieved per request.
This node is beneficial for scenarios such as:
- Archiving or backing up WhatsApp chat conversations.
- Analyzing customer support interactions by syncing chat histories.
- Integrating WhatsApp chat data into CRM or helpdesk systems.
- Monitoring ongoing conversations for automation or reporting purposes.
For example, a user can sync the last 50 messages from a specific WhatsApp group chat to analyze customer sentiment or track conversation history.
Properties
| Name | Meaning |
|---|---|
| WhatsApp Number | The ID of the WhatsApp number (device) to use for syncing messages. This identifies the source account. |
| Chat ID | The unique identifier of the chat to sync messages from. Examples: 447362053576@c.us for a user chat, or 44736205357600000000@g.us for a group chat. |
| Maximum Messages | The maximum number of recent messages to retrieve from the chat. Defaults to 50. |
| Page Number | The page number for paginated results, starting from 0. Allows fetching subsequent batches of messages. |
Output
The node outputs an array of JSON objects representing the synchronized chat messages. Each object corresponds to a single message with details such as sender, timestamp, content, and other metadata provided by the SparkBot API.
If binary data is included (e.g., media files in messages), it would be represented accordingly, but this node primarily focuses on JSON message data.
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.
- No additional environment variables are explicitly required beyond the API key credential.
Troubleshooting
Common Issues:
- Invalid or missing WhatsApp number (device) ID may cause authentication or resource not found errors.
- Incorrect Chat ID format can lead to failure in retrieving messages.
- Requesting too many messages or invalid page numbers might result in empty responses or API rate limits.
- Network connectivity issues with the SparkBot API endpoint.
Error Messages:
- Errors related to authentication usually indicate problems with the API key credential; verify that the key is valid and has necessary permissions.
- "Chat not found" or similar errors suggest the Chat ID does not exist or is inaccessible for the given WhatsApp number.
- Rate limit exceeded errors require reducing request frequency or batch size.
Resolution Tips:
- Double-check input parameters for correctness.
- Ensure the API key credential is correctly set up in n8n.
- Use smaller batch sizes and paginate through messages if large volumes are needed.
- Verify network access to the SparkBot API.
Links and References
- SparkBot WhatsApp API Documentation (hypothetical link)
- n8n documentation on Creating Custom Nodes
- General WhatsApp Business API concepts for understanding chat and message IDs.