Zalo OA icon

Zalo OA

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

Overview

This node integrates with the Zalo Official Account (OA) API to upload files to a Zalo OA. It supports uploading either binary data directly from the workflow or by providing a URL of the file to be uploaded. This functionality is useful for automating content management, such as sending media files or documents through Zalo OA, which is a popular messaging platform in Vietnam.

Typical use cases include:

  • Uploading images, GIFs, or other media files to Zalo OA for use in messages or posts.
  • Automating file uploads from external URLs without manual intervention.
  • Integrating Zalo OA file uploads into larger workflows that manage customer communication or marketing campaigns.

For example, you can automate uploading a promotional image stored in your workflow's binary data or upload a PDF brochure from a public URL to your Zalo OA account.

Properties

Name Meaning
Binary Data Boolean flag indicating if the file is provided as binary data within the workflow item.
Binary Property The name of the binary property containing the file data when Binary Data is true.
URL File The URL of the file to upload when Binary Data is false.

Output

The node outputs a JSON object representing the response from the Zalo OA API after attempting to upload the file. This typically includes information about the uploaded file such as its ID, URL, or any error messages returned by the API.

If the upload is successful, the output JSON will contain details confirming the file upload. If an error occurs, the output JSON will include an error flag, message, and possibly suggestions for troubleshooting.

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

Dependencies

  • Requires an active connection to the Zalo Official Account API.
  • Needs an API access token credential configured in n8n to authenticate requests.
  • Uses the axios HTTP client library to make API calls.
  • Uses the form-data library to handle multipart form uploads when sending binary data.

Troubleshooting

  • Missing Binary Property: If Binary Data is enabled but the specified binary property does not exist on the input item, the node will throw an error. Ensure the binary property name matches exactly and that the binary data is present.
  • Invalid File URL: When uploading via URL, ensure the URL is accessible and points directly to a valid file.
  • Authentication Errors: If the API token is invalid or expired, the upload will fail. Refresh or reconfigure the API credentials.
  • File Format Issues: The Zalo OA API may reject unsupported file formats. Verify the file type is supported by Zalo OA.
  • API Rate Limits or Permissions: Ensure the connected Zalo OA account has the necessary permissions and is not hitting rate limits.

Common error messages include:

  • "Error uploading file: <message>" — check network connectivity, file accessibility, and API token validity.
  • "No binary data property '<name>' exists on item." — verify the binary property name and presence of binary data.

Links and References

Discussion