Zalo OA icon

Zalo OA

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

Zalo OA → Upload File

AI-generated

Summary

Upload a file to the Zalo Official Account via either binary data from the workflow item or by specifying a URL to the file.

Inputs

  • binaryData — Boolean flag indicating if the file is provided as binary data in the workflow item. Defaults to false.
  • binaryProperty (required) — Name of the binary property containing the file data when 'binaryData' is true. Defaults to 'data'.
  • fileUrl (required) — URL of the file to be uploaded when 'binaryData' is false.

Output shape

a JSON object containing the response from the Zalo OA file upload API endpoint, including success or error information.

When 'binaryData' is true, the node reads the specified binary property from the input item, converts it to a buffer, and uploads it as a multipart/form-data POST request. When false, it uploads by sending the file URL as JSON in the POST body. On error, the output JSON includes error details and suggestions to verify file format and access permissions. Each input item produces a corresponding output item paired by item index.

Examples

Example 1: Upload a local file as binary data

Set 'Binary Data' to true and specify the binary property containing the file data (default 'data').

Example 2: Upload a file by URL

Set 'Binary Data' to false and provide the URL of the file in 'URL File' field.

Discussion