Zalo OA icon

Zalo OA

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

Overview

This node interacts with the Zalo Official Account (OA) API, specifically providing an operation to upload GIF images to a Zalo OA. It supports uploading GIFs either from binary data directly provided in the workflow or by downloading the GIF from a specified URL and then uploading it to the Zalo OA.

Common scenarios for this node include:

  • Automating the process of adding GIF content to a Zalo Official Account for marketing or customer engagement.
  • Integrating external systems that generate or store GIFs and pushing them to Zalo OA without manual intervention.
  • Using binary data from previous nodes in a workflow to upload GIFs seamlessly.

Practical example:

  • A user has a workflow that generates or receives GIF images as binary data (e.g., from a webhook or file read node). This node can take that binary data and upload it directly to the Zalo OA.
  • Alternatively, if the GIF is hosted on a public URL, the node can download it and upload it to the Zalo OA automatically.

Properties

Name Meaning
Binary Data Boolean flag indicating whether the GIF is provided as binary data (true) or via URL (false).
Binary Property The name of the binary property containing the GIF data when Binary Data is true.
URL Hình Ảnh GIF The URL of the GIF image to upload when Binary Data is false.

Output

The node outputs JSON data representing the response from the Zalo OA API after attempting to upload the GIF. The structure typically includes success status, uploaded file information, or error details if the upload failed.

If the upload is successful, the output JSON contains metadata about the uploaded GIF as returned by the Zalo OA API.

In case of errors, the output JSON includes:

  • An error flag set to true.
  • A descriptive message explaining the error.
  • The raw response data from the API if available.
  • A suggestion field advising to check the GIF format and OA access permissions.

The node does not output binary data itself; it only uploads binary data received as input.

Dependencies

  • Requires an active connection to the Zalo Official Account API using an API authentication token (access token).
  • Uses the axios library for HTTP requests.
  • Uses the form-data library to handle multipart form uploads when sending binary data.
  • Requires proper credentials configured in n8n for authenticating with the Zalo OA API.

Troubleshooting

  • No binary data property found: If Binary Data is enabled but the specified binary property does not exist on the input item, the node throws an error indicating the missing binary property. Ensure the binary property name matches exactly and that the previous node provides the binary data.
  • Invalid GIF format or access permission issues: Errors during upload often relate to unsupported file formats or insufficient permissions on the Zalo OA side. Check that the GIF is valid and that the access token has the necessary rights.
  • Network or download failures: When uploading via URL, if the node cannot download the GIF, it will fail. Verify the URL is accessible and returns a valid GIF.
  • API errors: The node logs detailed API response status and data on failure. Review these logs to understand specific API-side issues.
  • Access token expiration: Ensure the access token used is valid and not expired.

Links and References

Discussion