Actions9
Overview
This node manages Zalo users by interacting with the Zalo platform through an API. It supports various user-related operations such as blocking or unblocking a user, accepting or sending friend requests, changing account settings or avatar, retrieving user information, and finding users by phone number.
The "Chặn người dùng" (Block User) operation specifically allows you to block a Zalo user by their user ID. This is useful in scenarios where you want to prevent certain users from contacting or interacting with your Zalo account, for example, to avoid spam or unwanted communication.
Practical example:
You can automate moderation workflows by blocking users who send inappropriate messages or repeatedly request friendship without approval.
Properties
| Name | Meaning |
|---|---|
| User ID | The ID of the Zalo user to block |
Output
The output JSON contains two main fields:
status: A string indicating the result of the operation, typically"Thành công"which means "Success".response: The raw response returned by the Zalo API after attempting to block the user. This may include details about the blocked user or confirmation data.
Example output JSON:
{
"status": "Thành công",
"response": {
/* API response details */
}
}
No binary data output is produced by this operation.
Dependencies
- Requires a valid Zalo API credential with authentication details including cookie, IMEI, and user agent.
- The node uses the
zca-jslibrary to interact with the Zalo API. - Proper configuration of the Zalo API credential in n8n is necessary to authenticate requests.
Troubleshooting
Common issues:
- Invalid or expired credentials will cause login failure and prevent any operation.
- Missing or incorrect User ID input will cause errors when attempting to block a user.
- Network or API downtime may lead to request failures.
Error messages:
"No API instance found. Please make sure to provide valid credentials."
Means the node could not authenticate with Zalo API. Check that the API key/credential is correctly set up and valid.- Errors thrown during the block operation will be shown with their message. If "Continue On Fail" is enabled, the node will return the error message in the output JSON instead of stopping execution.
Links and References
- Zalo Official Developer Documentation (for general API reference)
- n8n Documentation (for setting up credentials and using custom nodes)