Actions9
Overview
This node manages Zalo user accounts by interacting with the Zalo platform through an API. Specifically, the "Đổi ảnh đại diện" (Change Account Avatar) operation allows users to update the profile picture of a specified Zalo user account.
Common scenarios for this node include automating profile updates for Zalo users in marketing campaigns, customer support bots, or personal account management workflows. For example, a business could automatically update the avatar of a Zalo account based on seasonal promotions or events.
Properties
| Name | Meaning |
|---|---|
| User ID | The unique identifier of the Zalo user whose avatar will be changed. |
| File Path | The local file path pointing to the new avatar image to upload as the user's profile picture. |
Output
The output JSON contains two main fields:
status: A string indicating the success status of the operation, e.g.,"Thành công"(Success).response: The raw response from the Zalo API after attempting to change the avatar. This typically includes details about the updated avatar or confirmation of the change.
No binary data is output by this node; it only returns JSON-formatted responses.
Example output JSON:
{
"status": "Thành công",
"response": {
// API response details here
}
}
Dependencies
- Requires valid Zalo API credentials including authentication cookies, device IMEI, and user agent strings.
- Uses an external library (
zca-js) to interact with the Zalo API. - The node expects these credentials to be configured in n8n under a generic API key credential setup.
- The file path provided must point to a valid image file accessible by the n8n runtime environment.
Troubleshooting
- Invalid Credentials: If the node throws an error about missing or invalid API instance, verify that the Zalo API credentials are correctly set up and contain valid cookie, IMEI, and user agent information.
- File Not Found: Ensure the file path points to an existing image file accessible by n8n. Incorrect paths or permission issues will cause failures.
- API Errors: If the Zalo API rejects the avatar change request, check the API response in the
responsefield for details. Common reasons include unsupported image formats or size limits. - Continue On Fail: If enabled, the node will continue processing other items even if one fails, returning error messages in the output JSON.
Links and References
- Zalo Official Developer Documentation
- n8n Documentation - Creating Custom Nodes
- zca-js GitHub Repository (Note: Replace with actual repo if available)