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 Sản Phẩm" (Get Product List) operation retrieves a list of products from the OA's store.

Common scenarios for this node include:

  • Fetching product lists to display or process in workflows.
  • Managing OA content like articles and categories.
  • Sending messages or media to users.
  • Handling follower information and tagging.

Practical example:

  • Use the "Lấy Danh Sách Sản Phẩm" operation to retrieve a paginated list of products starting from a specific offset, which can then be used to update an external inventory system or generate marketing campaigns.

Properties

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

Output

The output is a JSON object containing the response from the Zalo OA API endpoint for product listing. It typically includes:

  • data: An array of product objects, each representing a product with details such as ID, name, price, description, category, photos, and status.
  • Other metadata fields related to pagination or API response status.

If an error occurs, the output JSON will contain:

  • error: true
  • message: Description of the error encountered.
  • response: The raw response data from the API if available.
  • suggestion: Recommendations to resolve the issue.

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/v2.0/oa.
  • Relies on HTTP requests via Axios library to communicate with the Zalo OA API.
  • The API enforces limits such as maximum count per request (capped at 50).

Troubleshooting

Common Issues

  • Invalid or expired access token: The API calls will fail if the access token is missing, invalid, or expired.
  • Exceeding maximum count limit: Requests with count greater than 50 may be rejected or truncated by the API.
  • Incorrect parameter types or missing required parameters: Ensure offset and count are numbers and provided correctly.
  • Network or connectivity issues: Failures in reaching the Zalo API endpoint.

Error Messages and Resolutions

  • "Error getting product list: <message>": Indicates failure in API call; check network, access token validity, and parameter correctness.
  • Response status codes like 401 or 403 suggest authentication or permission issues; verify API credentials and permissions granted to the OA.
  • If the response contains detailed error info, review it to adjust parameters or permissions accordingly.

Links and References

Discussion