Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,090 of 9,090 pages
About the help in other languages
All help pages

Listing children and pagination

List the items of a folder for a list screen through the REST API - the list route and its defaults, offset and limit paging, infinite scroll, sorting by name, date or priority, the order of the path segments, the…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/mobile-app-developers/rest-api/listing-children-and-pagination.md

On this page

Listing children and pagination

This page is for app developers who build a list screen: the news of a folder, the products of a category. It explains the list route of the REST API, how to page through it and how to sort it.

Contents

  1. The route
  2. The answer
  3. Paging
  4. Sorting
  5. Counting
  6. What the list leaves out

The route

GET /api/ezp/<version>/content/node/<id>/list(/offset/<n>)(/limit/<n>)(/sort/<key>(/asc|desc))

Every part in brackets is optional, but the order is fixed: offset before limit, limit before sort. The route is a regular expression (ezpList in rest_provider.php) and the controller's own comment says so: "you can't provide sorting params before limit params". Defaults from the controller: offset 0, limit 10, sort order asc, and no sort key (the order then follows the default of the content query).

curl -s -H "Authorization: Bearer $EXP_API_KEY" \
     "https://example.com/api/ezp/v1/content/node/<node id>/list/offset/0/limit/20?ResponseGroups=Fields"

This exact pattern is the call of an existing mobile app, recorded in the guide's comparison of answers before and after 6.0.15 (Activation combinations).

The answer

{
  "childrenNodes": [
    {"objectName": "...", "classIdentifier": "article", "datePublished": 0, "dateModified": 0,
     "objectRemoteId": "...", "objectId": 0, "nodeId": 0, "nodeRemoteId": "...", "fullUrl": "https://example.com/...",
     "link": "https://example.com/api/ezp/v1/content/node/<id>", "fields": {"...": "..."}},
    "..."
  ],
  "metadata": {"childrenCount": 0, "parentNodeId": "<id>"},
  "requestedResponseGroups": ["Fields", "Metadata"]
}

The values are placeholders; the keys are those of getChildrenList() and doList(). fields appears only with ResponseGroups=Fields. link is the REST address of the child at the same version, with the request's Translation and OutputFormat parameters.

Paging

metadata.childrenCount is the number of all children the query finds, not of this page. Loop like this:

offset = 0, limit = 20
repeat:
    GET .../list/offset/{offset}/limit/{limit}
    show childrenNodes
    offset = offset + limit
until offset >= metadata.childrenCount

For infinite scroll, request the next page when the user nears the end of the loaded items, and stop when offset reaches childrenCount. Offsets shift when editors publish or remove items between two requests; deduplicate by nodeId in the app. The shipped configuration sets no maximum limit for this route; keep pages small (20 to 50) so the first screen appears fast on mobile networks.

Sorting

.../list/offset/0/limit/20/sort/published/desc
.../list/limit/50/sort/name

The sort key is passed to the content tree fetch as its SortBy value. The examples in the controller use name and published; the node sort names used by the same fetch elsewhere in the code (the expservices list in expcontentbase.php) are path, published, modified, section, depth, class_identifier, class_name, priority, name, modified_subnode, node_id and contentobject_id. To follow the order editors chose in the administration, sort by priority, or ask a remote service for the node's sort settings (expnode::sortInfo).

Counting

curl -s -H "Authorization: Bearer $EXP_API_KEY" https://example.com/api/ezp/v2/content/node/<node id>/childrenCount

Answers metadata with childrenCount and parentNodeId, for a badge or to size a list before loading it.

What the list leaves out

  • Only direct children (depth 1). For a whole subtree use expnode::subtree of the remote services.
  • No class filter. Filter in the app, or use expnode::children with a filter, or expnode::byClass (Calling expservices from an app).
  • Children the user may not read. A list checks content/read of its parent, "the children are filtered by the fetch" (Permissions of the REST interface).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x