Zalo User icon

Zalo User

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

Overview

This node interacts with the Zalo social platform to manage user-related operations. Specifically, for the "Zalo User" resource and the "Lấy Danh Sách Bạn Bè" (Get All Friends) operation, it retrieves a list of friends from a Zalo user account.

Common scenarios where this node is beneficial include:

  • Synchronizing a user's Zalo friend list with another system.
  • Analyzing or processing friend data for marketing or engagement purposes.
  • Automating workflows that require access to a user's social connections on Zalo.

For example, you could use this node to fetch up to 50 friends of a user and then send personalized messages or invitations based on that list.

Properties

Name Meaning
Limit The maximum number of friends to retrieve. You specify how many friends you want to get back, e.g., 10, 50, 100, etc.

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 one friend and includes their details as provided by the Zalo API.

Example output structure:

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

No binary data output is produced by this operation.

Dependencies

  • Requires valid Zalo API credentials including an API key credential that provides authentication via 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 in n8n beforehand.

Troubleshooting

  • Invalid Credentials: If the node throws an error about no API instance found or invalid credentials, verify that the Zalo API credentials are correctly set up with valid cookie, IMEI, and user agent values.
  • Empty Friend List: If the returned friend list is empty, ensure the authenticated user actually has friends on Zalo and that the API permissions allow access to friend data.
  • Limit Parameter Issues: Providing a non-numeric or negative value for the "Limit" property may cause unexpected behavior or errors. Always provide a positive integer.
  • API Rate Limits: Frequent calls to the Zalo API might hit rate limits; consider adding delays or handling retry logic externally.

Links and References

Discussion