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 to create a product category within the OA's store system. It allows users to define and add new categories for organizing products in their Zalo OA store.

Typical use cases include:

  • Automating the creation of product categories when onboarding new product lines.
  • Structuring product catalogs dynamically based on external data sources.
  • Managing product categories programmatically as part of an e-commerce workflow.

For example, a business using n8n to manage its Zalo OA store can automatically create categories like "Electronics," "Clothing," or "Accessories" with descriptions and images, helping keep the store organized without manual intervention.

Properties

Name Meaning
Tên Danh Mục (name) The name of the product category to be created.
Mô Tả Danh Mục (description) A textual description providing details about the category.
URL Hình Ảnh Danh Mục (photo) URL pointing to an image representing the category visually.
Trạng Thái Danh Mục (status) Display status of the category; options are: "Hiển Thị" (show) or "Ẩn" (hide).

Output

The node outputs a JSON object containing the response from the Zalo OA API after attempting to create the category. This typically includes:

  • Confirmation of the created category with its assigned ID.
  • Details such as name, description, status, and possibly the image URL.
  • Error information if the creation failed, including error messages and suggestions.

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to the Zalo Official Account API with a valid access token credential.
  • The node expects proper OAuth tokens or API keys configured in n8n credentials to authenticate requests.
  • Network access to https://openapi.zalo.me/v3.0/oa endpoint is necessary.
  • No additional external libraries beyond those bundled with n8n and axios for HTTP requests.

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 connected OA account must have permission to manage store categories.
  • Incorrect parameter values: Missing required fields like category name or malformed URLs for images can cause errors.
  • Network issues: Connectivity problems to the Zalo API endpoint will prevent successful requests.

Error Messages and Resolutions

  • "Error creating category: <message>": Indicates failure during the API call. Check the message for specifics.
  • "Please check the category parameters and OA access permissions.": Suggests that input parameters might be incorrect or the OA token lacks necessary rights.
  • HTTP status codes like 401 or 403 usually mean authentication or authorization failures; refresh or reconfigure credentials.
  • Validation errors may occur if required fields are empty or invalid; ensure all mandatory inputs are correctly set.

To resolve these issues:

  • Verify and refresh the API credentials in n8n.
  • Confirm that the OA account has the required permissions.
  • Double-check all input parameters for correctness.
  • Ensure stable internet connectivity.

Links and References

Discussion