Actions2
Get QR Code User
AI-generatedOverview
This node retrieves a user's QR code from the Zalo platform. It supports fetching the QR code for either the authenticated user or another specified user by their User ID. The node allows customization of the QR code type (currently only profile QR codes are supported), size, format, and appearance options such as including the avatar and colors. It is useful in scenarios where you want to programmatically obtain QR codes for user profiles, for example, to display them on websites, share them via messaging apps, or embed them in marketing materials.
Practical examples:
- Automatically generate and send your own profile QR code to new contacts.
- Retrieve and display QR codes of team members in an internal dashboard.
- Customize QR codes with specific colors or expiration times for event invitations.
Properties
| Name | Meaning |
|---|---|
| User ID | ID of the user whose QR code you want to get. Leave empty to get the QR code of the authenticated user. |
| QR Type | Type of QR code to retrieve. Currently only "Profile QR" is supported. |
| Include Avatar | Whether to include the user's avatar image inside the QR code (optional, does not affect API). |
| 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 optional advanced settings: |
| - Custom Message | Custom 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) color in hex format (e.g., #000000). |
Output
The node outputs JSON data containing:
operation: The operation performed ("getQRCodeUser").qrType: The type of QR code retrieved.result: An object with detailed QR code information including:success: Boolean indicating if the retrieval was successful.userId: The user ID for whom the QR code was fetched.userDisplayName: Display name of the user.includeAvatar: Whether the avatar was included.qrSize: Requested QR code size.format: Requested file format.qrCodeUrl: URL to the QR code image.qrCodeData: Raw QR code data (likely base64 or similar).url: Same asqrCodeUrl, the direct link to the QR code.expireTime: Expiration time of the QR code if any.response: Full raw response from the API enriched with user info.timestamp: Timestamp when the QR code was retrieved.debugInfoanddebug: Internal debug information about parameters and steps.
If the node encounters errors, it outputs JSON with success: false and error details.
The node does not output binary data directly; QR codes are provided as URLs or encoded data strings.
Dependencies
- Requires an authenticated session with the Zalo platform, including cookies, device IMEI, and user agent string.
- Uses an external library/module (imported dynamically) that provides login and QR code retrieval methods.
- Needs proper API authentication credentials configured in n8n to obtain the necessary session tokens.
- No direct environment variables are mentioned, but API keys or tokens must be set up in n8n credentials.
Troubleshooting
Common issues:
- Missing or invalid authentication credentials will cause login failure.
- Providing an invalid or non-existent User ID may result in no QR code returned.
- Unsupported operations or QR types will throw errors.
- Network or API downtime can cause request failures.
Error messages:
- "No valid cookie found" indicates missing or expired authentication session.
- "Unknown operation" occurs if an unsupported operation is requested.
- Errors during API calls include detailed messages and stack traces logged internally.
Resolutions:
- Ensure API credentials and session cookies are correctly configured and valid.
- Verify User ID correctness or leave blank to use the authenticated user.
- Use supported QR types and sizes.
- Check network connectivity and API status.
Links and References
- Zalo Official Developer Documentation
- QR Code Generation Concepts
- n8n documentation on Creating Custom Nodes
This summary is based solely on static analysis of the provided source code and property definitions.