Zalo OA icon

Zalo OA

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

Overview

The node integrates with the Zalo Official Account (OA) API, enabling users to send various types of messages and manage Zalo OA resources programmatically. Specifically, for the "Gửi Tin Nhắn Văn Bản" (Send Text Message) operation under the "Zalo OA" resource, it sends text messages to a specified user on Zalo.

This node is beneficial in scenarios such as:

  • Customer support automation by sending consultation messages.
  • Transactional notifications like order confirmations or alerts.
  • Promotional campaigns targeting followers with personalized messages.

Example use case: Automatically send a welcome message to new followers or notify customers about their transaction status via Zalo.

Properties

Name Meaning
Message Type Type of message to send. Options:
- Tin Tư Vấn (Customer Service): For consultation messages.
- Tin Giao Dịch (Transaction): For transactional messages.
- Tin Truyền Thông Cá Nhân (Promotion): For personal promotional messages.
User ID The unique identifier of the recipient user who will receive the text message.
Nội Dung Tin Nhắn (Text Content) The content of the text message to be sent.

Output

The output is a JSON object containing the response from the Zalo OA API after attempting to send the text message. This typically includes:

  • Status information indicating success or failure.
  • Any message IDs or metadata returned by the API.
  • Error details if the request failed.

No binary data is output for this operation.

Dependencies

  • Requires an API authentication token (access token) for the Zalo Official Account API.
  • Uses the Zalo OA API endpoint at https://openapi.zalo.me/v3.0/oa/message/{messageType}.
  • The node depends on the axios library for HTTP requests.
  • Requires proper configuration of credentials within n8n to provide the access token.

Troubleshooting

  • Common issues:

    • Invalid or expired access token leading to authentication errors.
    • Incorrect or missing userId causing message delivery failure.
    • Message content exceeding allowed length or containing unsupported characters.
  • Error messages:

    • Errors returned from the Zalo API will be included in the output JSON under error fields.
    • If the API returns an error, check the access token validity and permissions.
    • Ensure the userId corresponds to a valid follower of the OA.
    • Verify that the message type matches one of the supported options.
  • Resolution tips:

    • Refresh or reconfigure the API token if authentication fails.
    • Validate input parameters before execution.
    • Consult Zalo OA API documentation for message format and limits.

Links and References

Discussion