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 Zalo OA features. Specifically, the "Gửi Tin Nhắn File" (Send File Message) operation allows sending a file message to a specified user on Zalo via their user ID and a previously uploaded file ID.

Common scenarios for this node include:

  • Automating customer support by sending files such as PDFs or documents directly to users.
  • Delivering digital content or resources automatically after user interaction.
  • Integrating Zalo messaging into workflows that require file sharing.

Example: Sending a contract PDF to a user after they complete a form submission.

Properties

Name Meaning
User ID The unique identifier of the recipient user on Zalo who will receive the file message.
ID File The identifier of the file that has already been uploaded to the Zalo OA platform.

Output

The node outputs a JSON object containing the response from the Zalo OA API after attempting to send the file message. This typically includes status information about the message delivery, any error messages if the request failed, and other metadata returned by the API.

No binary data output is produced by this operation.

Dependencies

  • Requires an active Zalo Official Account API access token credential configured in n8n.
  • Uses the Zalo OA API endpoint https://openapi.zalo.me/v2.0/oa/message for sending messages.
  • Relies on the axios HTTP client library for making API requests.

Troubleshooting

  • Common issues:

    • Invalid or expired access token leading to authentication errors.
    • Incorrect or missing user ID or file ID parameters causing API rejections.
    • File ID not corresponding to an uploaded file or expired upload token.
  • Error messages and resolutions:

    • "error": true with message indicating invalid token: Refresh or reconfigure the API credentials.
    • Errors related to missing binary data or file upload: Ensure the file is uploaded successfully before sending.
    • API response errors may include suggestions to check permissions or parameter correctness; verify that the Zalo OA has granted necessary permissions and that IDs are accurate.

Links and References

Discussion