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 manage various aspects of their Zalo OA such as messaging, followers, tags, articles, products, categories, and orders. Specifically, the "Lấy Danh Sách Danh Mục" (Get Category List) operation retrieves a paginated list of product categories associated with the OA.

Common scenarios for this node include:

  • Fetching product categories to display or synchronize with other systems.
  • Managing OA content like articles and products.
  • Sending messages to users via Zalo.
  • Tagging and managing followers.

Practical example:

  • An e-commerce business using Zalo OA can use this node to fetch product categories to update their inventory system or display categories in a chatbot menu.

Properties

Name Meaning
Vị Trí Bắt Đầu (offset) The starting position (offset) in the category list from which to begin fetching categories. Default is 0.
Số Lượng (count) The number of categories to retrieve. Maximum capped at 50 by the API. Default is 10.

Output

The output JSON contains the response data from the Zalo OA API endpoint /store/category/getcategoryofoa. This typically includes:

  • A list of categories with details such as category ID, name, description, status, and possibly parent category information.
  • Metadata about pagination or total counts may also be included depending on the API response.

If an error occurs, the output JSON will contain an error field set to true, a descriptive message, and optionally the raw API response data along with suggestions for troubleshooting.

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 OA API base URL: https://openapi.zalo.me/v3.0/oa.
  • Relies on HTTP requests made via Axios library.
  • The API enforces limits on count parameter (max 50).

Troubleshooting

  • Common issues:

    • Invalid or expired access token: The API will return authentication errors. Ensure the API key/token is valid and has required permissions.
    • Exceeding maximum count: The API caps the number of categories returned per request to 50.
    • Network or connectivity problems may cause request failures.
  • Error messages:

    • "Error getting category list: <message>": Indicates failure calling the API. Check network, token validity, and API permissions.
    • Response status codes and data are logged internally for debugging.
  • Resolution tips:

    • Verify that the access token has permission to read store categories.
    • Confirm that the offset and count parameters are within valid ranges.
    • Review Zalo OA API documentation for any changes or updates to endpoints.

Links and References

Discussion