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
This node enables interaction with WhatsApp sessions via the SparkBot WhatsApp API, specifically focusing on scanning QR codes to establish or refresh a WhatsApp session. It is useful when you need to authenticate or re-authenticate a WhatsApp number by scanning a QR code, which is a common step in connecting WhatsApp Business API clients or similar integrations.
Typical use cases include:
- Initial setup of a WhatsApp session by scanning the QR code.
- Forcing a new QR code generation if the existing session is invalid or expired.
- Retrieving the QR code in various formats for display or processing in different environments.
For example, you might use this node to generate a QR code that your user can scan with their WhatsApp mobile app to link their WhatsApp number to your automation workflow.
Properties
| Name | Meaning |
|---|---|
| WhatsApp Number | The ID of the WhatsApp number (device) to scan the QR code for. This is selected from available devices. |
| Force New QR | Boolean option to force destroying any existing session and request a fresh QR code. Defaults to false. |
| QR Encoding | Format in which the QR image is returned. Options include: SVG (default), JSON, Base64, Base64 URI, URI, Image. |
Output
The node outputs a JSON object containing the result of the QR code scan operation. The exact structure depends on the QR encoding format chosen but generally includes the QR code data in the specified format.
If the QR code is returned as an image or encoded string, it can be used directly for display or further processing.
No binary output is indicated in the source code for this operation.
Dependencies
- Requires an active connection to the SparkBot WhatsApp API service.
- Needs an API key credential configured in n8n to authenticate requests to the SparkBot API.
- The node relies on dynamically loaded device options to select the WhatsApp number, so the environment must support loading these options properly.
Troubleshooting
Common issues:
- Failure to load available WhatsApp numbers (devices) may indicate connectivity or authentication problems.
- If forcing a new QR code fails, ensure the current session is not locked or in an inconsistent state.
- Incorrect QR encoding selection might lead to unusable QR code data.
Error messages:
- Errors related to authentication usually mean the API key is missing, invalid, or expired.
- Network errors suggest connectivity issues with the SparkBot API endpoint.
- Session-related errors may require manual intervention to reset or clear sessions.
To resolve these, verify API credentials, network access, and session states in the SparkBot dashboard or management interface.
Links and References
- SparkBot WhatsApp API Documentation (example placeholder, replace with actual URL)
- n8n documentation on Creating Custom Nodes
- WhatsApp Business API official docs for understanding QR code session linking: https://developers.facebook.com/docs/whatsapp/api/sessions