Actions9
Overview
This node manages Zalo user accounts by interacting with the Zalo platform through an API. It supports various user-related operations such as accepting or sending friend requests, blocking/unblocking users, changing account settings including the avatar, retrieving user information, and searching for users.
The specific operation "Đổi ảnh đại diện" (Change Account Avatar) allows you to update a user's profile picture on Zalo by providing the user ID and the file path of the new avatar image.
Practical examples:
- Automatically update a user's profile picture based on external triggers or events.
- Batch update avatars for multiple users by feeding user IDs and image paths.
- Integrate with other systems to synchronize user profile images.
Properties
| Name | Meaning |
|---|---|
| User ID | The unique identifier of the Zalo user whose avatar will be changed. |
| File Path | The local or accessible file path pointing to the new avatar image to upload. |
Output
The output JSON contains two main fields:
status: A string indicating the success status, typically"Thành công"meaning "Success".response: The raw response from the Zalo API after attempting to change the avatar. This may include details about the updated avatar or confirmation data.
Example output structure:
{
"status": "Thành công",
"response": {
// API response details here
}
}
No binary data is output by this node; it only returns JSON responses.
Dependencies
- Requires a valid Zalo API credential with authentication details such as cookie, IMEI, and user agent.
- Uses the
zca-jslibrary to interact with the Zalo API. - The node expects the provided file path to point to a valid image file accessible by the execution environment.
Troubleshooting
Common issues:
- Invalid or expired credentials can cause login failures.
- Incorrect or inaccessible file paths will prevent the avatar from being updated.
- Network or API errors from Zalo may interrupt the process.
Error messages:
"No API instance found. Please make sure to provide valid credentials."
Means the node could not authenticate with Zalo. Verify your API credentials and ensure they are correctly configured.- Errors related to file access or upload failure usually indicate problems with the file path or permissions.
- If the node throws errors during execution but
continueOnFailis enabled, it will return error messages per item instead of stopping.
Links and References
- Zalo Official Developer Documentation
- n8n Documentation on Creating Custom Nodes
- zca-js GitHub Repository (for the underlying Zalo API client used)