Actions2
Get QR Profile
AI-generatedOverview
This node retrieves a QR code profile from the Zalo platform, which is a popular messaging and social media app. It is designed to fetch a user's QR code profile image with customizable options such as size, format, colors, expiration time, and an optional custom message.
Common scenarios where this node is beneficial include:
- Automating the generation or retrieval of user QR codes for marketing or customer engagement.
- Integrating Zalo QR profiles into CRM systems or contact management workflows.
- Customizing QR codes dynamically before sharing or displaying them in applications.
Practical example:
- A business wants to automatically generate and send personalized Zalo QR codes to customers with specific branding colors and expiration times for promotional campaigns.
Properties
| Name | Meaning |
|---|---|
| QR Type | Type of QR code to retrieve. Currently only "Profile QR" is supported. |
| Include Avatar | Whether to include the avatar image within the QR code (optional, does not affect API call). |
| QR Size | Size of the QR code image. Options: Small (200x200), Medium (300x300), Large (500x500). |
| Format | File format of the QR code image. Options: PNG, JPEG, SVG (vector). |
| Advanced Options | Collection of additional customization options: |
| - Custom Message | Custom text message to accompany the QR code. |
| - Expire Time | Expiration time of the QR code in seconds (0 means no expiration). |
| - Background Color | Background color of the QR code in hex format (e.g., #FFFFFF). |
| - Foreground Color | Foreground (QR code dots) color in hex format (e.g., #000000). |
Output
The node outputs an array containing one object per input item with the following JSON structure:
operation: The operation performed, e.g., "getQRProfile".qrType: The type of QR code requested.success: Boolean indicating if the operation succeeded.timestamp: ISO timestamp of when the operation was performed.userId: The user ID associated with the QR code.userDisplayName: Display name of the user.includeAvatar: Whether the avatar was included.qrSize: The size of the QR code image.format: The file format of the QR code.qrCodeUrl: URL string pointing to the generated QR code image.qrCodeData: Raw data of the QR code (likely base64 or similar).url: Same asqrCodeUrl, redundant for convenience.expireTime: Expiration time of the QR code in seconds.response: Full raw response object from the API including user info and QR code details.debugInfo: Debugging information about steps and parameters used.debug: Additional debug metadata about QR code parameters and flags.
If the node encounters an error during execution, it returns an object with:
operationerror: Error message stringsuccess: falsetimestamp
The node does not output binary data directly but provides URLs and raw data strings representing the QR code.
Dependencies
- Requires an authenticated session cookie, IMEI, and user agent string to log in to the Zalo service internally.
- Uses an external library/module (imported dynamically) to handle login and QR code retrieval.
- Depends on proper API credentials or authentication tokens configured in n8n to access the Zalo API.
- No direct environment variables are referenced in the provided code snippet, but API keys or tokens must be set up in n8n credentials.
Troubleshooting
Common Issues
- Missing or invalid authentication credentials will cause login failure.
- Unsupported operations other than "Get QR Profile" will throw an "Unknown operation" error.
- Network or API errors during QR code retrieval will result in detailed error messages logged and returned.
- Invalid or missing user ID in the input data will cause validation errors.
Error Messages and Resolutions
- "No valid cookie found": Ensure that the authentication cookie is correctly provided and valid.
- "Unknown operation": Verify that the operation property is set to "Get QR Profile".
- "getQR is not a function": Indicates internal API method missing; check that the external dependency/library is properly installed and imported.
- API call errors with detailed stack traces: Review API credentials, network connectivity, and input parameters.
Links and References
- Zalo Official Developer Documentation
- QR Code Generation Best Practices
- n8n Documentation for setting up credentials and custom nodes