codedao12 - Zalo Login By QR
AI-generatedOverview
This node implements a Zalo login process using QR code authentication. It facilitates generating a QR code for login, monitoring the login status, handling user confirmation or decline, and retrieving user credentials upon successful login. The node supports optional proxy configuration for API requests and can send notifications about the QR code and login status to a Telegram chat. It is useful for automating Zalo login in workflows, especially when integrating Zalo services with other systems or automations.
Use Case Examples
- Automate Zalo login by generating a QR code and waiting for user scan and confirmation.
- Use a proxy to route Zalo API requests for login in restricted network environments.
- Send QR code and login status notifications to a Telegram chat for monitoring.
Properties
| Name | Meaning |
|---|---|
| Proxy | HTTP proxy to use for Zalo API requests, specified as http(s)://user:pass@host:port. |
| Notifications to Telegram | Boolean flag to enable sending QR code and status updates to a Telegram chat. |
| Bot Token | The token for your Telegram bot, required if sending notifications to Telegram is enabled. |
| Chat ID | Telegram chat_id to send notifications to, required if sending notifications to Telegram is enabled. |
Output
JSON
jsonsuccess- Indicates if the login process was successful.state- Current state of the login process.message- Informational message about the login process.fileName- File name of the QR code image.usingExistingCredential- Indicates if an existing credential was used.credentialType- Type of credential used, e.g., n8nZaloApi.userInfo
*displayName- Display name of the logged-in user.
*avatar- Avatar URL of the logged-in user.zaloApiInfo
*imei- IMEI associated with the Zalo API client.
*userAgent- User agent string used for the Zalo API client.
*zaloUserId- Zalo user ID of the logged-in user.webhook
*enabled- Indicates if webhook is enabled.
binarydata- Binary data of the QR code image.
Dependencies
- an API key credential for n8n Zalo API
- Telegram bot token if notifications to Telegram are enabled
Troubleshooting
- Proxy configuration errors: Ensure the proxy URL is valid and accessible. Error messages about invalid proxy or connection failures indicate misconfiguration.
- Timeout generating QR code: The node waits for a QR code to be generated within 45 seconds; if it times out, retry the login process.
- QR code expiration: The QR code is valid for about 45 seconds; if expired, a new QR code must be generated.
- Login declined or aborted: If the user declines or aborts the QR login on their device, the node throws specific errors indicating the cancellation.
- Missing required parameters: Ensure that the context has required fields like imei, cookie, and userAgent before login.
- Telegram notification failures: If enabled, failures to send messages to Telegram are logged but do not stop the login process.