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 (OA) API, enabling users to manage and interact with their Zalo OA. Specifically, the "Cập Nhật Menu OA" (Update OA Menu) operation allows updating the menu items of a Zalo Official Account. This is useful for businesses or service providers who want to customize the interactive menu shown to their followers on Zalo, directing users to URLs, sending messages, making calls, or opening apps directly from the menu.

Practical examples include:

  • Adding a menu item that opens a promotional webpage.
  • Creating a menu option that sends a predefined message to the user.
  • Providing quick call buttons via the menu.
  • Linking to a mobile app feature through the menu.

This operation helps improve user engagement by tailoring the OA menu to specific business needs.

Properties

Name Meaning
Menu Items A list of menu items to set for the OA menu. Each menu item includes:
- Tên Menu (title): The display name of the menu item.
- Loại Menu (type): The action type when the user clicks the menu item. Options are:
- Mở URL (Open URL)
- Gửi Tin Nhắn (Send Message)
- Gọi Điện (Call Phone)
- Mở Ứng Dụng (Open App)
- Giá Trị (payload): The value corresponding to the menu type, e.g., URL, message text, phone number, or app identifier.

Output

The output JSON contains the response from the Zalo OA API after attempting to update the menu. It typically includes status information indicating success or failure of the update request.

Example structure of each menu item sent in the request body:

{
  "title": "Menu Item Title",
  "type": "oa.open.url",
  "payload": {
    "url": "https://example.com"
  }
}

The node outputs an array of such responses, one per input item processed.

Dependencies

  • Requires an API access token credential for Zalo Official Account API authentication.
  • Uses the Zalo OA API endpoint at https://openapi.zalo.me/v3.0/oa/menu.
  • Requires proper permissions granted to the access token to update the OA menu.

Troubleshooting

  • Common issues:

    • Invalid or expired access token causing authorization errors.
    • Incorrectly formatted menu items or payloads leading to API validation errors.
    • Insufficient permissions on the OA to update the menu.
  • Error messages:

    • Errors returned from the API will be included in the output JSON under error fields.
    • If the API returns an error, check the access token validity and ensure the OA has granted the necessary rights.
    • Verify that the payload values match the expected format for each menu type (e.g., valid URLs for "Mở URL", valid phone numbers for "Gọi Điện").

Links and References

Discussion