Tạo Mới
AI-generatedOverview
This node manages CMS pages on the Sapo platform, allowing users to perform various operations such as creating, retrieving, updating, deleting, counting, and listing pages. It is particularly useful for automating content management workflows in e-commerce or website projects that use Sapo as their CMS backend.
A common scenario is automatically creating new informational pages (e.g., "About Us", "Contact") with predefined content or updating existing pages programmatically based on external data sources. For example, a marketing team could automate publishing promotional pages without manual intervention.
Properties
| Name | Meaning |
|---|---|
| Thao Tác | The operation to perform on the page resource. Options: Đếm (count), Tạo Mới (create), Xóa (delete), Lấy Chi Tiết (get), Lấy Danh Sách (getMany), Cập Nhật (update) |
| ID Trang | The unique numeric identifier of the page, required for get, update, and delete operations. |
| Trả Về Tất Cả | Boolean flag indicating whether to return all pages when listing (getMany) or limit the results. |
| Giới Hạn | Maximum number of pages to return when not returning all (used with getMany). |
| Thông Tin Bổ Sung | Additional optional filters for listing pages, such as published status, handle (URL slug), creation and update date ranges. |
| Dữ Liệu Trang | JSON object containing the page data to create or update. Example fields include title, body_html, handle, published status, template suffix, and author. |
Output
The node outputs an array with one item per execution containing a json field:
- For create, get, update, getMany, and count operations, the
jsoncontains the response data from the Sapo API representing the page(s) or count. - For delete, the output JSON contains
{ success: true }upon successful deletion. - In case of errors (if "Continue On Fail" is enabled), the output JSON contains an
errorfield with the error message.
No binary data is output by this node.
Dependencies
- Requires an active connection to the Sapo API via an API key credential configured in n8n.
- Uses the internal Sapo API base class to interact with the Sapo CMS endpoints.
- No additional environment variables are explicitly required beyond the API authentication setup.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Providing an invalid page ID for get, update, or delete operations will result in not found errors.
- Malformed JSON in the "Dữ Liệu Trang" property can cause request failures.
- Exceeding rate limits or network issues may cause intermittent errors.
Error messages:
- Errors returned from the Sapo API are surfaced with their message and stack trace.
- To resolve, verify API credentials, ensure correct page IDs, and validate JSON input.
- Use the "Continue On Fail" option to handle errors gracefully within workflows.
Links and References
- Sapo CMS API Documentation (general reference for API endpoints)
- n8n documentation on Creating Custom Nodes