Sapo Trang icon

Sapo Trang

Quản lý trang CMS trên Sapo

Cập Nhật

AI-generated

Overview

This node manages CMS pages on the Sapo platform, allowing users to create, retrieve, update, delete, count, and list pages. It is useful for automating content management workflows such as updating page content, fetching page details for display or processing, and managing large numbers of pages programmatically.

Practical examples:

  • Automatically update a page’s content when product information changes.
  • Retrieve a list of published pages to generate a sitemap.
  • Delete outdated pages in bulk based on certain criteria.
  • Count the number of pages matching specific filters for reporting.

Properties

Name Meaning
ID Trang The unique numeric identifier of the page to get, update, or delete.
Dữ Liệu Trang JSON object containing the page data to create or update. Example fields include title, body_html, handle (URL slug), published status, template suffix, and author.

Note: The "ID Trang" property is required for operations "get", "update", and "delete". The "Dữ Liệu Trang" property is required for "create" and "update" operations.

Output

The node outputs an array with one item containing a json field:

  • For create, get, update, and getMany operations, the json contains the page data returned by the API, which includes all relevant page properties such as title, content, handle, publication status, etc.
  • For delete, the output JSON contains { success: true } if deletion was successful.
  • For count, the output JSON contains { count: <number> } representing the total number of pages matching the filter criteria.
  • In case of errors (if "Continue On Fail" is enabled), the output JSON contains an error field with the error message.

The node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating with the Sapo platform.
  • Depends on the internal Sapo API base class to perform HTTP requests to the Sapo CMS endpoints.
  • No additional environment variables are explicitly required beyond the API authentication setup.

Troubleshooting

  • Common issues:
    • Invalid or missing page ID when performing "get", "update", or "delete" operations will cause errors.
    • Malformed JSON in the "Dữ Liệu Trang" property can lead to request failures.
    • Insufficient permissions or invalid API credentials will result in authentication errors.
  • Error messages:
    • Errors from the API are caught and either thrown or returned in the output depending on the "Continue On Fail" setting.
    • Typical error messages include "Page not found", "Invalid JSON format", or "Unauthorized".
  • Resolution tips:
    • Verify that the page ID exists and is correct.
    • Ensure the JSON data is valid and matches the expected schema.
    • Confirm that the API key credential is correctly configured and has necessary permissions.

Links and References

Discussion