Navigation
Top-Level Navigation
This endpoints returns all navigation items from the top level of the navigation root and adds additional items based on control panel settings. By default it will only return the first level of items but this can be expanded by providing the expand.navigation.depth parameter.
GET /news/@navigation 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.getNavigation({
token: login.data.token,
path: '/news',
});
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"@id": "http://localhost:8080/news/@navigation",
"items": [
{
"@id": "http://localhost:8080/events",
"@type": "Folder",
"title": "Events",
"UID": "1a2123ba-14e8-4910-8e6b-c04a40d72a41",
"path": "/events",
"Description": null,
"Title": "Events",
"Subject": null,
"is_folderish": true,
"markdown": "# Events\n\n",
"items": [],
"end": null,
"exclude_from_nav": false,
"Type": "Folder",
"getId": "events",
"Creator": "admin",
"id": "events",
"image_field": "",
"image_scales": {},
"portal_type": "Folder",
"review_state": "published",
"start": null,
"recurrence": null,
"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": 248,
"hasPreviewImage": false,
"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"
},
{
"@id": "http://localhost:8080/news",
"@type": "Folder",
"title": "News",
"UID": "32215c67-86de-462a-8cc0-eabcd2b39c26",
"path": "/news",
"Description": "News Items",
"Title": "News",
"Subject": null,
"is_folderish": true,
"markdown": "# News\n\n",
"items": [],
"end": null,
"exclude_from_nav": false,
"Type": "Folder",
"getId": "news",
"Creator": "admin",
"id": "news",
"image_field": "",
"image_scales": {},
"portal_type": "Folder",
"review_state": "published",
"start": null,
"recurrence": null,
"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,
"hasPreviewImage": false,
"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"
},
{
"@id": "http://localhost:8080/users",
"@type": "Folder",
"title": "Users",
"UID": "80994493-74ca-4b94-9a7c-145a33a6dd80",
"path": "/users",
"Description": null,
"Title": "Users",
"Subject": null,
"is_folderish": true,
"markdown": "# Users\n\n",
"items": [],
"end": null,
"exclude_from_nav": false,
"Type": "Folder",
"getId": "users",
"Creator": "admin",
"id": "users",
"image_field": "",
"image_scales": {},
"portal_type": "Folder",
"review_state": "published",
"start": null,
"recurrence": null,
"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,
"hasPreviewImage": false,
"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"
}
]
}