Zalo User icon

Zalo User

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

Overview

This node interacts with the Zalo platform to manage user-related operations, specifically focusing on handling friends and user information. The "Lấy danh sách bạn bè" (Get all friends) operation retrieves a list of friends from a Zalo user account, allowing users to fetch their friend list up to a specified limit.

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 communication purposes.
  • Automating friend management tasks such as sending or accepting friend requests.

Practical example:

  • A marketing automation workflow that fetches the first 50 friends of a user to send personalized messages or offers.

Properties

Name Meaning
Limit The maximum number of friend results to retrieve. For example, setting it to 50 returns up to 50 friends.

Output

The output JSON contains a field named friends, which is an array of friend objects retrieved from the Zalo account. Each object represents a friend with their associated details as provided by the Zalo API.

Example structure of the output JSON:

{
  "friends": [
    {
      // Friend details here (e.g., id, name, avatar, etc.)
    },
    ...
  ]
}

No binary data output is produced by this operation.

Dependencies

  • Requires valid Zalo API credentials including authentication tokens such as cookies, device identifiers (IMEI), and user agent strings.
  • The node depends on the external zca-js library to interact with the Zalo API.
  • Proper configuration of the Zalo API credential in n8n is necessary to authenticate and perform operations.

Troubleshooting

  • Common issues:

    • Invalid or expired credentials may cause authentication failures.
    • Missing or incorrect cookie, IMEI, or user agent values can prevent successful login.
    • Requesting more friends than available may return fewer results than the specified limit.
  • Error messages:

    • "No API instance found. Please make sure to provide valid credentials."
      This indicates failure to authenticate with Zalo API. Verify that the API credentials are correctly set and valid.
    • Errors related to network or API response issues may occur if Zalo's service is unreachable or rate-limited.
  • Resolution tips:

    • Ensure the API key credential is up-to-date and has proper permissions.
    • Check that the input properties like limit are within acceptable ranges.
    • Use the "Continue On Fail" option in n8n to handle individual item errors gracefully.

Links and References

Discussion