Zalo OA icon

Zalo OA

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

Overview

This node interacts with the Zalo Official Account (OA) API, enabling automation and management of various OA features. Specifically, the "Cập Nhật Menu OA" (Update OA Menu) operation allows users to update the menu items displayed on their Zalo Official Account.

Typical use cases include:

  • Customizing the OA menu to provide quick access links or actions for users.
  • Updating menu options dynamically based on campaigns or user interactions.
  • Integrating with other workflows to automate menu changes without manual intervention.

For example, a business can set menu items that open URLs, send predefined messages, initiate phone calls, or open apps directly from the Zalo chat interface.

Properties

Name Meaning
Menu Items A list of menu items to be set on the OA menu. Each 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 selected type (e.g., URL, message text, phone number, app identifier).

Output

The output is a JSON object representing the response from the Zalo OA API after attempting to update the menu. It typically contains status information about the success or failure of the update request.

Example structure (simplified):

{
  "error": 0,
  "message": "Success",
  "data": {
    // Additional data returned by the API
  }
}

If an error occurs, the output JSON will contain error details such as:

{
  "error": 1,
  "message": "Error description here"
}

No binary data output is involved in 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/v2.0/oa/menu.
  • The node depends on the axios HTTP client library for making API requests.
  • Proper permissions must be granted to the API token to allow menu updates.

Troubleshooting

Common Issues

  • Invalid or expired access token: The API call will fail if the access token is missing, invalid, or expired.
  • Incorrect menu item payloads: Payload values must match the expected format for each menu type (e.g., valid URLs for "Open URL", valid phone numbers for "Call Phone").
  • API permission errors: The token must have sufficient rights to update the OA menu.
  • Network or connectivity issues: Failures in reaching the Zalo API endpoint.

Error Messages and Resolutions

  • "error": 1, "message": "Invalid access token"
    Resolution: Verify and refresh the API token credentials.

  • "error": 1, "message": "Invalid menu item payload"
    Resolution: Check that the payload matches the required format for the selected menu type.

  • Network errors or timeouts
    Resolution: Ensure stable internet connection and that the Zalo API service is reachable.

  • Unexpected API responses or failures
    Resolution: Review API documentation for any changes; check if the OA account has necessary permissions.

Links and References


This summary focuses exclusively on the "Cập Nhật Menu OA" operation within the Zalo OA resource, describing its input properties, output, dependencies, and troubleshooting tips based on static analysis of the provided source code.

Discussion