Zalo OA icon

Zalo OA

Tương tác với Zalo Official Account API

Overview

The "Zalo OA" node integrates with the Zalo Official Account API, enabling automation of various interactions and management tasks related to a Zalo Official Account. Specifically, the Upload Hình Ảnh (Upload Image) operation allows users to upload images to their Zalo OA either by providing an image URL or by sending binary image data directly.

This operation is useful in scenarios where you want to programmatically add images to your Zalo Official Account for use in messages, posts, or other content managed via the Zalo platform. For example, you might automate uploading product images, promotional banners, or user-generated content images as part of a marketing workflow.

Properties

Name Meaning
Binary Data Boolean option indicating if the image is provided as binary data (true) or as a URL (false).
Binary Property The name of the binary property containing the image data when Binary Data is true.
URL Hình Ảnh The URL of the image to upload when Binary Data is false.
  • If Binary Data is set to true, the node expects the image data to be present in the specified binary property.
  • If Binary Data is false, the node uploads the image from the given URL.

Output

The output JSON contains the response from the Zalo OA API after attempting to upload the image. This typically includes information about the uploaded image such as its ID or URL on the Zalo platform.

If an error occurs during upload, the output JSON will contain:

  • error: true
  • message: Description of the error encountered
  • response: The raw response data from the API (if available)
  • suggestion: Tips to resolve common issues (e.g., checking image format or access permissions)

The node does not output binary data itself; it only returns metadata and status information about the upload.

Dependencies

  • Requires an active connection to the Zalo Official Account API using a valid access token credential.
  • Uses the axios library for HTTP requests.
  • Uses the form-data library to handle multipart form uploads when sending binary data.
  • The node expects proper configuration of credentials within n8n to authenticate API calls.

Troubleshooting

  • No binary data property exists: If Binary Data is true but the specified binary property is missing in the input item, the node throws an error indicating the missing property.
  • Invalid image format or inaccessible URL: Upload may fail if the image URL is invalid, inaccessible, or the binary data is corrupted or unsupported. Check that the image is accessible and in a supported format.
  • Access token issues: Errors related to authentication usually indicate expired or invalid tokens. Ensure the API key/credential is valid and has the necessary permissions.
  • API errors: The node logs detailed error messages including HTTP status codes and API response bodies to help diagnose issues.
  • Permission errors: The suggestion field often advises verifying that the Zalo OA has granted the required permissions to perform image uploads.

Links and References


This summary focuses exclusively on the Upload Hình Ảnh operation of the Zalo OA node as requested.

Discussion