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 to retrieve a list of categories associated with the OA. It is useful for workflows that need to manage or display category data from a Zalo OA, such as organizing products, posts, or tags into categories.

A common scenario is when you want to fetch a paginated list of categories to show in a dashboard or to use their IDs/names for further operations like assigning categories to products or filtering content.

For example, you can use this node to:

  • Retrieve the first 10 categories starting from offset 0.
  • Paginate through categories by adjusting the offset and count parameters.
  • Use the returned category IDs and names to tag or organize other OA resources.

Properties

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

Output

The output JSON contains the response from the Zalo OA API endpoint that returns the category list. The structure includes:

  • data: An array of category objects, each containing:
    • tag_id (or id): The unique identifier of the category.
    • tag_name (or name): The name of the category.
    • display_info: A string combining the ID and name for easy display (e.g., "ID: 12345 - Name: CategoryName").
  • message: A message indicating success, e.g., "Lấy danh sách tag thành công" ("Successfully retrieved tag list").
  • example: An example note suggesting how to use the tag_id or tag_name values in other nodes for tagging users.

If an error occurs, the output JSON will contain:

  • error: true
  • message: Error description
  • response: Raw API response details if available
  • suggestion: Tips on how to resolve the issue

No binary data output is involved in this operation.

Dependencies

  • Requires a valid Zalo Official Account API access token with appropriate permissions.
  • The node expects the access token to be provided via credentials or fetched from environment variables or database storage.
  • Uses the Zalo OA API endpoint: https://openapi.zalo.me/v3.0/oa/store/category/getcategoryofoa
  • HTTP requests are made using Axios library.
  • No additional external services beyond Zalo OA API are required.

Troubleshooting

Common Issues

  • Invalid or expired access token: The API call will fail if the access token is missing, invalid, or expired.
  • Insufficient permissions: The token must have permission to read category information.
  • Incorrect offset/count values: Using negative offsets or counts exceeding the maximum limit (usually 50) may cause errors.
  • Network or API downtime: Temporary network issues or Zalo API outages can cause request failures.

Common Error Messages and Resolutions

  • "Error getting category list: <error message>"
    Check your access token validity and permissions. Refresh or reauthenticate if necessary.

  • "Please check the parameters and OA access permissions."
    Verify that the offset and count parameters are within allowed ranges and that the OA has granted the required scopes.

  • If the response contains an error object with detailed API response, review the status code and message for clues (e.g., 401 Unauthorized means token issues).

Links and References


This summary is based solely on static analysis of the provided source code and property definitions.

Discussion