Get all pages
In this example, we demonstrate how to retrieve all pages from the CMS project (not just root-level ones) using the OneEntry API.
β
Purpose of the scenario:
- Connect to the OneEntry API
- Retrieve all pages across all depth levels in a single call
- Filter pages by type using the type field
β
What you need:
- A valid PROJECT_URL and APP_TOKEN for authentication with the OneEntry API.
- At least one page configured in OneEntry.
π Important:
- These examples do not include error handling.
- You can manage errors using a try-catch block or by employing a construction like await Promise.catch((error) => error).
- Returns a plain array, NOT `{ items, total }`. Includes pages of all depths β use depth field or parentId to build a tree.
- The type field is "common_page" for content pages and "catalog_page" for pages with products.
- The products field on each page object shows the count of products assigned to that page.
π See in documentation:
π¦ SDK reference:
Loading sandboxβ¦
