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 who are flagged by other systems, ensuring your Zalo account remains secure and free from harassment.
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 from the Zalo API after attempting to block the user. This may include details about the blocked user or confirmation data.
Example output structure:
{
"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 containing authentication details such as cookies, device IMEI, and user agent.
- The node uses the
zca-jslibrary 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 will cause the node to fail to authenticate with the Zalo API.
- Missing or incorrect User ID input will result in errors when attempting to block a user.
- Network or API downtime can cause request failures.
Error messages:
"No API instance found. Please make sure to provide valid credentials."
Means the node could not establish a connection to the Zalo API due to missing or invalid credentials. Verify that the API key/credential is correctly set up.- Errors related to specific user IDs usually indicate that the user does not exist or cannot be blocked. Double-check the User ID value.
- If the node is set to continue on failure, errors will be included in the output JSON under the
errorfield for each failed item.
Links and References
- Zalo Official Developer Documentation (for API details and authentication)
- n8n Documentation (for general node usage and credential setup)