ZaloOA icon

ZaloOA

Consume ZaloOA API

Overview

The "Upload File" operation of the ZaloOA n8n node allows users to upload a file to the Zalo Official Account (OA) platform. This is useful for automating workflows that require sending files, such as images or documents, to Zalo OA for messaging or storage purposes. Common scenarios include integrating Zalo OA with other systems to automate content delivery, customer support, or marketing campaigns.

Example use cases:

  • Automatically uploading user-generated content from a web form to Zalo OA.
  • Sending product brochures or images to customers via Zalo messages.
  • Integrating with cloud storage services to forward files to Zalo OA.

Properties

Name Meaning
Authentication Select the authentication method. Options: Parameter Credentials, Predefined Credentials
Base URL The base URL that serves the API. Only shown when using Parameter Credentials.
Access Token OA access token. Required for authenticating API requests. Only shown when using Parameter Credentials.
Property Name Name of the binary property which contains the data for the file to be uploaded. Specify the property in your input that holds the file's data.

Output

  • The output will contain a json field with the response from the Zalo OA API after uploading the file.
  • The structure typically includes information about the uploaded file, such as its ID, name, and possibly a URL or status message.
  • If the upload is successful, expect fields like:
    {
      "data": {
        "attachment_id": "string",
        "type": "image",
        "name": "filename.jpg"
      },
      "message": "Success",
      "error": 0
    }
    
  • If there is an error, the output may include an error code and message.

Note: The node can handle binary data uploads; the actual file content should be provided in the specified binary property.

Dependencies

  • Requires a valid Zalo OA access token.
  • May require configuration of credentials in n8n, either as parameter credentials or predefined credentials.
  • External dependency: Access to the Zalo OA API (https://openapi.zalo.me/v3.0/oa).

Troubleshooting

  • Invalid Access Token: If the access token is missing or incorrect, you may receive authentication errors. Ensure the token is valid and has not expired.
  • Missing Binary Data: If the specified binary property does not exist or is empty, the upload will fail. Make sure the input item contains the correct binary property with file data.
  • API Errors: Any issues with the Zalo OA API (such as rate limits or server errors) will be reflected in the output's error fields. Check the error code and message for details.
  • Incorrect Property Name: If the "Property Name" does not match the binary property in your input, the node will not find the file to upload.

Links and References

Discussion