Zalo User icon

Zalo User

Quản lý người dùng Zalo

Overview

This node interacts with Zalo's user-related functionalities, allowing you to manage and retrieve information about Zalo users. It is useful for automating tasks such as fetching user details, managing friend requests, blocking or unblocking users, and updating user profile settings on the Zalo platform.

Practical examples include:

  • Automatically retrieving detailed information about a specific Zalo user by their User ID.
  • Accepting or sending friend requests programmatically.
  • Blocking or unblocking users based on certain criteria.
  • Changing a friend's alias name in your contact list.
  • Undoing sent messages in conversations.

These operations help streamline social interactions and user management within Zalo through automation workflows.

Properties

Name Meaning
User ID The unique identifier of the Zalo user to perform the operation on (required).

For the "Lấy thông tin người dùng" (Get User Info) operation, the only required input property is User ID, which specifies the target user whose information will be retrieved.

Output

The output JSON structure depends on the operation performed:

  • For the getUserInfo operation, the output JSON contains the full user information object returned by the Zalo API for the specified User ID.

    Example output snippet:

    {
      // Full user info fields as returned by Zalo API
    }
    
  • For other operations like accepting friend requests, sending friend requests, blocking/unblocking users, changing alias names, etc., the output JSON includes:

    • A status field indicating success (e.g., "Thành công" meaning "Success").
    • A response field containing the raw response from the Zalo API for that action.

Each output item is paired with its corresponding input item index for traceability.

Dependencies

  • Requires valid Zalo API credentials including an API key credential with cookie, IMEI, and user agent information.
  • Uses the external zca-js library to interact with the Zalo API.
  • The node expects these credentials to be configured properly in n8n before execution.

Troubleshooting

  • No API instance found error: This occurs if the node cannot establish a connection to the Zalo API using the provided credentials. Ensure that the API key credential is valid and contains correct cookie, IMEI, and user agent data.
  • Operation failures: If an operation fails (e.g., invalid User ID, insufficient permissions), the node throws an error unless "Continue On Fail" is enabled, in which case it outputs the error message per item.
  • Invalid or missing User ID: Since User ID is required for most user operations, ensure it is correctly provided; otherwise, the API call will fail.
  • Rate limits or API restrictions: Be aware of any rate limits imposed by Zalo API which might cause temporary failures.

Links and References

Discussion