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.
Loading sandbox…