Zalo OA icon

Zalo OA

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

Overview

The "Zalo OA" node integrates with the Zalo Official Account API, enabling users to interact programmatically with Zalo's messaging and content management features. Specifically, the "Gửi Tin Nhắn Danh Sách" (Send List Message) operation allows sending a structured list message to a specified user on Zalo. This type of message is useful for presenting multiple items or options in a visually organized format, such as product catalogs, menus, or informational lists.

Typical use cases include:

  • Sending promotional lists or product catalogs to customers.
  • Delivering menu options or service lists in customer support scenarios.
  • Sharing curated content collections with followers.

For example, a business can send a list message containing several products, each with a title, description, image, and a link to more details, enhancing user engagement through rich content.

Properties

Name Meaning
User ID The unique identifier of the recipient user who will receive the list message.
Tiêu Đề The title of the list message; appears as the main heading or button label in the message.
Danh Sách Mục A collection of list items ("Mục") included in the message. Each item includes:
- Tiêu Đề Mục Title of the individual list item.
- Mô Tả Description text providing additional information about the list item.
- URL Hình Ảnh URL pointing to an image representing the list item.
- Default Action URL URL that opens when the user clicks on the list item, typically leading to detailed content.

Output

The node outputs JSON data reflecting the response from the Zalo Official Account API after attempting to send the list message. The structure generally includes status information, success indicators, and any error messages returned by the API.

Example output JSON structure (simplified):

{
  "message_id": "string",
  "error": 0,
  "message": "Success"
}

If the message fails to send, the output JSON will contain error details explaining the failure.

The node does not output binary data for this operation.

Dependencies

  • Requires an active Zalo Official Account API access token credential configured in n8n.
  • Uses the Zalo OpenAPI endpoint at https://openapi.zalo.me/v2.0/oa.
  • Relies on HTTP POST requests with JSON payloads to communicate with the Zalo API.

Troubleshooting

  • Common Issues:

    • Invalid or expired access token: Ensure the API key credential is valid and has not expired.
    • Incorrect user ID: Verify the recipient's user ID is correct and corresponds to a follower of the OA.
    • Malformed list elements: Each list item must have valid URLs and non-empty titles; invalid URLs or missing required fields may cause API errors.
    • Network or API downtime: Temporary connectivity issues can cause failures.
  • Error Messages:

    • Errors returned from the API are included in the output JSON under error codes and messages.
    • If the node throws an error related to missing binary data, it usually indicates misconfiguration in other operations but is not typical for this operation.
  • Resolution Tips:

    • Double-check all input parameters for correctness.
    • Confirm the OA has permission to send messages to the target user.
    • Review API documentation for any changes in endpoint requirements.
    • Use the node's error output to diagnose specific API response errors.

Links and References

Discussion