Sapo Trường Tùy Chỉnh icon

Sapo Trường Tùy Chỉnh

Quản lý trường tùy chỉnh trên Sapo

Blog → Cập Nhật

AI-generated

Overview

This node manages custom metafields on various resources within the Sapo platform, such as blogs, articles, products, and more. It allows users to create, retrieve, update, delete, count, validate, and bulk delete metafields associated with a specific resource.

For the Blog resource with the Update operation, the node updates an existing custom metafield identified by its ID for a specified blog post. This is useful when you want to modify metadata like inventory details, descriptions, or any custom data attached to a blog entry.

Practical example:
You have a blog post with a metafield storing a warehouse location. If the location changes, you can use this node to update the metafield's value to reflect the new storage location without manually editing it in the Sapo admin panel.

Properties

Name Meaning
ID Tài Nguyên The unique numeric identifier of the blog resource (blog post) where the metafield exists.
ID Trường Tùy Chỉnh The unique numeric identifier of the custom metafield to update.
Dữ Liệu Trường Tùy Chỉnh JSON object containing the metafield data to update. Includes fields like namespace, key, value, value_type, and description.

Explanation of Dữ Liệu Trường Tùy Chỉnh JSON structure example:

{
  "namespace": "inventory",
  "key": "warehouse_location",
  "value": "A-12",
  "value_type": "string",
  "description": "Storage location in warehouse"
}
  • namespace: Logical grouping of metafields.
  • key: Identifier for the metafield.
  • value: The actual data stored.
  • value_type: Data type of the value (e.g., string).
  • description: Human-readable explanation of the metafield.

Output

The node outputs a JSON object representing the updated metafield after the operation completes successfully. The structure corresponds to the metafield resource returned by the Sapo API, typically including identifiers, namespace, key, value, value type, description, and timestamps.

If the operation fails and "Continue On Fail" is enabled, the output will contain an error object with a message describing the failure.

Dependencies

  • Requires an active connection to the Sapo API via an API authentication credential configured in n8n.
  • The node depends on the internal SapoApiBase class to interact with the Sapo metafields endpoints.
  • Proper permissions on the Sapo account to update metafields on blog resources are necessary.

Troubleshooting

  • Common issues:
    • Invalid or missing resourceId or metafieldId will cause errors because the node cannot identify which metafield to update.
    • Malformed JSON in the data property may lead to request failures.
    • Insufficient API permissions or expired credentials will result in authentication errors.
  • Error messages:
    • "Resource not found": Check that the blog ID and metafield ID exist and are correct.
    • "Invalid metafield data": Verify the JSON structure and required fields in the data input.
    • "Authentication failed": Ensure the API key or token is valid and has proper access rights.
  • To resolve errors, verify all IDs, ensure JSON correctness, and confirm API credentials.

Links and References

Discussion