Zalo User icon

Zalo User

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

Overview

This node manages Zalo users by interacting with the Zalo platform through various user-related operations. Specifically, for the "Chặn người dùng" (Block User) operation, it allows you to block a specified Zalo user by their user ID. This is useful in scenarios where you want to programmatically restrict communication or interaction with certain users on Zalo, such as blocking spam accounts or unwanted contacts.

Practical example: Automatically block users who send unsolicited messages by feeding their user IDs into this node, helping maintain a clean and controlled contact list.

Properties

Name Meaning
User ID The ID of the Zalo user to block

Output

The node outputs a JSON object containing:

  • status: A string indicating the result of the operation, typically "Thành công" meaning "Success".
  • response: The raw response from the Zalo API after attempting to block the user, which may include details about the action's success or failure.

Example output JSON:

{
  "status": "Thành công",
  "response": {
    /* API response details */
  }
}

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, device IMEI, and user agent.
  • The node depends on the external zca-js library to interact with the Zalo API.
  • Proper configuration of the Zalo API credential within n8n is necessary to authenticate requests.

Troubleshooting

  • Common issues:

    • Invalid or expired credentials can cause authentication failures.
    • Providing an incorrect or non-existent User ID will likely result in an error from the Zalo API.
    • Network connectivity problems may prevent successful API calls.
  • Error messages:

    • "No API instance found. Please make sure to provide valid credentials."
      Means the node could not authenticate with Zalo due to missing or invalid credentials. Verify your API key and credential setup.
    • Errors returned from the API (e.g., user not found, permission denied) will be thrown and can be caught if "Continue On Fail" is enabled, allowing workflow continuation with error details in output.

Links and References

Discussion