Zalo User icon

Zalo User

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

Overview

This node, named "Zalo User," manages interactions with Zalo user accounts through various operations such as managing friend requests, blocking/unblocking users, changing account settings, and retrieving user information. Specifically, the operation "Lấy danh sách bạn bè" (Get all friends) fetches a list of friends for the authenticated Zalo user.

Common scenarios where this node is beneficial include:

  • Automating social media workflows involving Zalo contacts.
  • Integrating Zalo user data into CRM or marketing platforms.
  • Managing friend lists programmatically for outreach or analysis.
  • Synchronizing Zalo contacts with other systems.

For example, you can use the "Lấy danh sách bạn bè" operation to retrieve up to a specified number of friends from a Zalo account and then process or export that list within your workflow.

Properties

Name Meaning
Limit The maximum number of friends to retrieve from the user's friend list. Default is 50.

Output

The output JSON contains a single field:

  • friends: An array of friend objects representing the retrieved friends from the Zalo account. Each object corresponds to a friend’s details as returned by the Zalo API.

Example output structure:

{
  "friends": [
    {
      "id": "123456789",
      "name": "Friend Name",
      "avatar": "https://example.com/avatar.jpg",
      // ... other friend properties
    },
    // more friend objects
  ]
}

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential to authenticate with the Zalo platform.
  • The node uses stored credentials including a cookie, device IMEI, and user agent string to establish a session with Zalo's API.
  • The external library zca-js is used internally to interact with the Zalo API.
  • Proper configuration of the Zalo API credentials in n8n is necessary before using this node.

Troubleshooting

  • Invalid or expired credentials: If the node throws an error about missing or invalid API instance, ensure that the provided API key credential is valid and has not expired. Refresh or reauthenticate if needed.
  • Empty friend list: If the returned friend list is empty, verify that the authenticated user actually has friends on Zalo and that the API permissions allow access to friend data.
  • Limit parameter issues: Setting the limit too high might cause performance issues or API rate limiting. Use reasonable limits according to your needs.
  • Network or API errors: Temporary network failures or API downtime may cause errors. Retry after some time or check Zalo service status.

Links and References

Discussion