Context Navigation
Context Navigation
The context navigation endpoint can be used to get the navigation in the current location. By default it will recursively get all the child nodes. The expand.contextnavigation.bottomLevel query parameter can be used to limit the depth it will go. The expand.contextnavigation.includeTop can be used to also include the top level node.
GET /@contextnavigation HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImZ1bGxuYW1lIjoiQWRtaW4iLCJpYXQiOjE2NDkzMTI0NDl9.RS1Ny_r0v7vIylFfK6q0JVJrkiDuTOh9iG9IL8xbzAk
Or use the client directly:
import { Client } from '@robgietema/nick';
const cli = Client.initialize({ apiPath: 'http://localhost:8080' });
const login = await cli.login({
data: { login: 'admin', password: 'admin' },
});
const { data } = await cli.getContextNavigation({
token: login.data.token,
path: '/',
});
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"@id": "http://localhost:8080/@contextnavigation",
"items": [
{
"@id": "http://localhost:8080/events",
"@type": "Folder",
"title": "Events",
"getId": "events",
"Creator": "admin",
"UID": "1a2123ba-14e8-4910-8e6b-c04a40d72a41",
"path": "/events",
"Description": null,
"Title": "Events",
"Subject": null,
"is_folderish": true,
"exclude_from_nav": false,
"Type": "Folder",
"id": "events",
"portal_type": "Folder",
"review_state": "published",
"modified": "2022-04-02T20:30:00.000Z",
"Date": "2022-04-02T20:30:00.000Z",
"expires": null,
"created": "2022-04-02T20:30:00.000Z",
"effective": "2022-04-02T20:30:00.000Z",
"getObjSize": 192,
"listCreators": ["admin"],
"mime_type": null,
"CreationDate": "2022-04-02T20:30:00.000Z",
"EffectiveDate": "2022-04-02T20:30:00.000Z",
"ExpirationDate": null,
"ModificationDate": "2022-04-02T20:30:00.000Z",
"image_field": "",
"image_scales": {},
"start": null,
"end": null,
"recurrence": null,
"hasPreviewImage": false,
"markdown": "# Events\n\n",
"items": [
{
"@id": "http://localhost:8080/events/event-1",
"@type": "Event",
"title": "Event 1",
"getId": "event-1",
"Creator": "admin",
"UID": "405ca717-0c68-43a0-88ac-629a82658675",
"path": "/events/event-1",
"Description": null,
"Title": "Event 1",
"Subject": ["event"],
"is_folderish": true,
"exclude_from_nav": false,
"Type": "Event",
"id": "event-1",
"portal_type": "Event",
"review_state": "published",
"modified": "2022-04-02T20:10:00.000Z",
"Date": "2022-04-02T20:10:00.000Z",
"expires": null,
"created": "2022-04-02T20:10:00.000Z",
"effective": "2022-04-02T20:10:00.000Z",
"getObjSize": 1090,
"listCreators": ["admin"],
"mime_type": null,
"CreationDate": "2022-04-02T20:10:00.000Z",
"EffectiveDate": "2022-04-02T20:10:00.000Z",
"ExpirationDate": null,
"ModificationDate": "2022-04-02T20:10:00.000Z",
"image_field": "",
"image_scales": {},
"start": "2026-04-01T12:49:09.565Z",
"end": "2026-04-08T12:49:11.379Z",
"recurrence": "DTSTART:20260401T124909Z\nRRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20260408T124900Z",
"hasPreviewImage": false,
"markdown": "# Event 1\n\nThis is the first event.\n\n",
"items": []
},
{
"@id": "http://localhost:8080/events/event-2",
"@type": "Event",
"title": "Event 2",
"getId": "event-2",
"Creator": "admin",
"UID": "455ca717-0c68-43a0-88ac-629a82658675",
"path": "/events/event-2",
"Description": null,
"Title": "Event 2",
"Subject": ["event"],
"is_folderish": true,
"exclude_from_nav": false,
"Type": "Event",
"id": "event-2",
"portal_type": "Event",
"review_state": "published",
"modified": "2023-04-02T20:10:00.000Z",
"Date": "2023-04-02T20:10:00.000Z",
"expires": null,
"created": "2023-04-02T20:10:00.000Z",
"effective": "2023-04-02T20:10:00.000Z",
"getObjSize": 631,
"listCreators": ["admin"],
"mime_type": null,
"CreationDate": "2023-04-02T20:10:00.000Z",
"EffectiveDate": "2023-04-02T20:10:00.000Z",
"ExpirationDate": null,
"ModificationDate": "2023-04-02T20:10:00.000Z",
"image_field": "",
"image_scales": {},
"start": "2025-04-01T12:49:09.565Z",
"end": "2025-04-08T12:49:11.379Z",
"recurrence": "DTSTART:20250401T124909Z\nRRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20250408T124900Z",
"hasPreviewImage": false,
"markdown": "# Event 2\n\nThis is the first event.\n\n",
"items": []
}
]
},
{
"@id": "http://localhost:8080/news",
"@type": "Folder",
"title": "News",
"getId": "news",
"Creator": "admin",
"UID": "32215c67-86de-462a-8cc0-eabcd2b39c26",
"path": "/news",
"Description": "News Items",
"Title": "News",
"Subject": null,
"is_folderish": true,
"exclude_from_nav": false,
"Type": "Folder",
"id": "news",
"portal_type": "Folder",
"review_state": "published",
"modified": "2022-04-02T20:22:00.000Z",
"Date": "2022-04-02T20:22:00.000Z",
"expires": null,
"created": "2022-04-02T20:22:00.000Z",
"effective": "2022-04-02T20:22:00.000Z",
"getObjSize": 217,
"listCreators": ["admin"],
"mime_type": null,
"CreationDate": "2022-04-02T20:22:00.000Z",
"EffectiveDate": "2022-04-02T20:22:00.000Z",
"ExpirationDate": null,
"ModificationDate": "2022-04-02T20:22:00.000Z",
"image_field": "",
"image_scales": {},
"start": null,
"end": null,
"recurrence": null,
"hasPreviewImage": false,
"markdown": "# News\n\n",
"items": []
},
{
"@id": "http://localhost:8080/users",
"@type": "Folder",
"title": "Users",
"getId": "users",
"Creator": "admin",
"UID": "80994493-74ca-4b94-9a7c-145a33a6dd80",
"path": "/users",
"Description": null,
"Title": "Users",
"Subject": null,
"is_folderish": true,
"exclude_from_nav": false,
"Type": "Folder",
"id": "users",
"portal_type": "Folder",
"review_state": "published",
"modified": "2022-04-02T20:24:00.000Z",
"Date": "2022-04-02T20:24:00.000Z",
"expires": null,
"created": "2022-04-02T20:24:00.000Z",
"effective": "2022-04-02T20:24:00.000Z",
"getObjSize": 191,
"listCreators": ["admin"],
"mime_type": null,
"CreationDate": "2022-04-02T20:24:00.000Z",
"EffectiveDate": "2022-04-02T20:24:00.000Z",
"ExpirationDate": null,
"ModificationDate": "2022-04-02T20:24:00.000Z",
"image_field": "",
"image_scales": {},
"start": null,
"end": null,
"recurrence": null,
"hasPreviewImage": false,
"markdown": "# Users\n\n",
"items": []
}
]
}