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, enabling users to interact programmatically with their Zalo OA. Specifically, the Upload Hình Ảnh GIF operation allows uploading GIF images either from binary data within the workflow or by downloading from a provided URL and then uploading it to the Zalo OA platform.

Typical use cases include:

  • Automating the upload of GIFs to Zalo OA for use in messages or posts.
  • Integrating external sources of GIFs into Zalo OA content workflows.
  • Handling media uploads dynamically within an automation pipeline.

For example, you might have a workflow that receives GIF files as attachments or URLs and automatically uploads them to your Zalo OA for later use in customer interactions or marketing campaigns.

Properties

Name Meaning
Binary Data Boolean flag indicating if the GIF is provided as binary data (true) or as a 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. This typically includes information about the uploaded file such as its ID, URL, or status.

If the upload fails, the output JSON will contain error details including:

  • An error flag set to true.
  • A descriptive message explaining the failure.
  • The raw API response data if available.
  • A suggestion field providing guidance on how to resolve common issues.

The node does not output binary data directly; it only handles uploading binary data or URLs and returns the API response.

Dependencies

  • Requires an API authentication token credential for Zalo OA API access.
  • 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 permissions granted to the API token for uploading media to the Zalo OA.

Troubleshooting

Common Issues

  • Missing binary data property: If Binary Data is enabled but the specified binary property does not exist on the input item, the node throws an error.
  • Invalid GIF format: Upload may fail if the GIF file is corrupted or not properly formatted.
  • Access token or permission errors: If the API token lacks required permissions or is invalid/expired, the upload will fail.
  • Network or URL download failures: When uploading via URL, if the URL is inaccessible or the download fails, the node will report an error.

Error Messages and Resolutions

  • No binary data property "X" exists on item.
    Ensure the binary property name matches exactly the property containing the GIF data in the input.

  • Error uploading GIF: <message>
    Check the GIF file format and ensure the OA access token has upload permissions.

  • API response errors with status codes (e.g., 401 Unauthorized, 403 Forbidden)
    Verify the API token validity and permissions in the Zalo OA configuration.

  • Network errors during URL download
    Confirm the URL is publicly accessible and points to a valid GIF file.

Links and References


This summary focuses exclusively on the Upload Hình Ảnh GIF operation of the Zalo OA node based on static code analysis and provided property definitions.

Discussion