Zalo User icon

Zalo User

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

Overview

The Zalo User node with the Đổi ảnh đại diện (Change Account Avatar) operation allows you to programmatically change a Zalo user's profile picture. This is useful for automating user account management tasks, such as updating avatars in bulk or integrating avatar changes into onboarding workflows.

Practical examples:

  • Automatically update a user's avatar after they upload a new photo in your app.
  • Batch-update avatars for multiple users based on organizational branding.
  • Integrate with HR systems to keep employee Zalo avatars up-to-date.

Properties

Name Type Meaning
User ID String ID của người dùng cần đổi ảnh đại diện
(ID of the user whose avatar will be changed)
File Path String Đường dẫn đến file ảnh đại diện
(Path to the image file to use as the new avatar)

Output

The output for each processed item will have the following structure:

{
  "status": "Thành công",
  "response": { /* API response from Zalo SDK */ }
}
  • status: Always set to "Thành công" (Success) if the operation completes without error.
  • response: Contains the raw response returned by the Zalo SDK's changeAccountAvatar method. The exact structure depends on the underlying library but typically includes details about the avatar update result.

If an error occurs and "Continue On Fail" is enabled, the output will look like:

{
  "error": "Error message"
}

Dependencies

  • External Service: Requires access to the Zalo platform via the zca-js library.
  • Credentials: Needs valid Zalo credentials (zaloApi) including:
    • cookie
    • imei
    • userAgent
  • n8n Configuration: Ensure that the Zalo credential is configured in n8n under the name "Zalo Credential to connect with".

Troubleshooting

Common Issues:

  • Invalid Credentials: If the provided cookie, IMEI, or user agent are incorrect or expired, the node will throw:
    "No API instance found. Please make sure to provide valid credentials."
    Resolution: Double-check your Zalo credentials and ensure they are current.
  • File Not Found: If the specified file path does not exist or is inaccessible, the operation may fail.
    Resolution: Verify the file path is correct and accessible by the n8n server.
  • API Errors: Any errors from the Zalo API will be surfaced in the error field if "Continue On Fail" is enabled.

Links and References

Discussion