Zalo Login Via QR Code icon

Zalo Login Via QR Code

Đăng nhập Zalo bằng QR Code - Tự động lưu thông tin đăng nhập và gửi webhook thông báo

Overview

This node enables logging into the Zalo platform using a QR code. It automates the process of generating a login QR code, monitoring its status (such as scanned, expired, or declined), and retrieving user information upon successful login. The node can send webhook notifications about these events to a specified URL, allowing real-time updates on the login process.

Common scenarios for this node include:

  • Automating Zalo account logins in workflows without manual intervention.
  • Integrating Zalo login status updates into other systems via webhooks.
  • Managing multiple Zalo sessions identified by unique states.
  • Using proxies or custom domains for API requests to adapt to network environments.

Practical example:

  • A workflow that generates a Zalo login QR code for a user session "user1", waits for the user to scan it, and upon successful login, triggers downstream automation such as sending welcome messages or syncing contacts.

Properties

Name Meaning
State Unique identifier for the login session to distinguish between different accounts or sessions.
Proxy Optional HTTP proxy URL (e.g., https://user:pass@host:port) used for connecting to Zalo API.
Domain Custom domain for Zalo API requests (default is https://zalo.me).
Webhook URL URL to receive webhook event notifications like QR code expiration, scanning, login success.
Enable Webhook Boolean flag to enable or disable sending webhook notifications for login events.

Output

The node outputs an array with one item containing:

  • json: An object with detailed information about the login process and results:

    • success: Boolean indicating if the operation was successful.
    • state: The unique session identifier provided in input.
    • message: Status message describing the current state or result.
    • fileName: The filename for the generated QR code image (login.png).
    • usingExistingCredential: Boolean indicating if an existing credential was used.
    • credentialType: Type of credential used (generic description).
    • userInfo: Object with user's display name and avatar availability.
    • zaloApiInfo: Contains IMEI, user agent string, and Zalo user ID if available.
    • webhook: Details about webhook configuration including enabled status, URL, state, and supported events.
    • Additional fields related to credentials and internal state may be present for debugging or informational purposes.
  • binary: Contains the QR code image data encoded as a PNG file under the key data. This binary data represents the QR code that users scan to authenticate.

Dependencies

  • Requires access to Zalo API services, which may need authentication credentials.
  • Supports optional use of an HTTP proxy for API connections.
  • Requires a valid webhook URL if webhook notifications are enabled.
  • Uses an external Zalo SDK library internally to handle login and event listening.
  • May require n8n credentials configured for Zalo API access or a generic API key credential.
  • Network connectivity to Zalo servers and optionally to the webhook endpoint.

Troubleshooting

  • QR Code Not Generated: If the QR code cannot be retrieved, ensure the Zalo API credentials are correct and the network connection is stable.
  • Webhook Failures: If webhook notifications fail, verify the webhook URL is reachable and accepts POST requests with JSON payloads.
  • Timeout Errors: The node waits up to 30 seconds for QR code scanning; if timeout occurs, the QR code expires. Retry with a new execution.
  • Proxy Issues: Incorrect proxy settings can block API communication. Confirm proxy URL format and credentials.
  • Credential Errors: Missing or invalid credentials will prevent login. Check that required API keys or tokens are properly set in n8n.
  • Event Handling Warnings: Logs may show warnings if unexpected events occur or if login info is incomplete. Review logs for details.

Links and References

Discussion