Get the navigation for a site
get
/resources/v1/aggregates/{siteName}/navigation
The resource endpoint returns the navigation data for a given site name.
Important Note: It is a Singular Resource. The response is in an aggregated asset format (refer to note in Asset Resource end point). It is similar to Asset Resource end point except in addition to asset info, it also gives navigation data. So all the aggregate asset query params (assetDepth, expand, fields, segments, profileName) are also applicable to this resource. All the navigation data (child nodes w.r.t navigation) is available in the 'children' array in the response. Each child is again an aggregated asset. The given aggregate asset query params are also applied to each child in the children array.
Important Note: It is a Singular Resource. The response is in an aggregated asset format (refer to note in Asset Resource end point). It is similar to Asset Resource end point except in addition to asset info, it also gives navigation data. So all the aggregate asset query params (assetDepth, expand, fields, segments, profileName) are also applicable to this resource. All the navigation data (child nodes w.r.t navigation) is available in the 'children' array in the response. Each child is again an aggregated asset. The given aggregate asset query params are also applied to each child in the children array.
The following tables summarize the client request.
Path Parameters
Name | Description | Format |
---|---|---|
siteName | Name of the site | string |
Query Parameters
Name | Description | Format |
---|---|---|
assetDepth | To know about this parameter, refer to the 'assetDepth' query param in Asset Resource. Applicable to each child in the children array also. | number |
code | Accepts a comma-separated list of site node types. Determines whether placed or unplaced children nodes (pages) under a publication (site) are to be returned. The default node type is placed. Usage:
|
string |
expand | Accepts a comma-separated list of assetTypes. To know more about this parameter, refer to the 'expand' query param in Asset Resource. Applicable to each child in the children array also. | string |
fields | To know about this parameter, refer to the 'fields' query param in Asset Resource. Applicable to each child in the children array also. The 'children' array cannot be filtered out from the response. | string |
links | Accepts a comma-separated list of link names. By default, this parameter gives all the links (schema, self, and canonical resources). | string |
navigationDepth | Accepts any positive integer or the string "all". The navigation depth as an integer defines the children level to which to traverse the site navigation. The string "all" refers to the full depth. The default value is 2. In case of an invalid navigationDepth value (negative number), the default navigationDepth value is used. The children of a node are available in a children array. This children attribute cannot be filtered out. Each children item is again aggregated, and all the query parameters of the aggregated asset are applicable to each item. | number |
profileName | To know about this parameter, refer to the 'profileName' query param in Asset Resource. Applicable to each child in the children array also. | string |
segments | To know about this parameter, refer to the 'segments' query param in Asset Resource. Applicable to each child in the children array also. | string |
The following tables summarize the server response.
Supported Media Types
- application/json
200 Response
Site navigation data in aggregated format
Example
The following example shows how to get all site navigation names in the avisports sample site in WebCenter Sites, by submitting a GET request on the REST resource using cURL.
Query param details:
"navigationDepth=1": All sites navigations are under the avisports site at navigation level 1.
"assetDepth=0&fields=SiteNavigation(name)": All children (site navigations) are available in a 'children' array. Each child (SiteNavigation) is an aggregated asset. We are interested only in the SiteNavigation name.
curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation?navigationDepth=1&assetDepth=0&fields=SiteNavigation(name)"
Example of Response Header
The following example shows the response header.
HTTP/1.1 200 OK ETag: "ccdf0e0da3b8075d082650baef783a3d92552ee91c082c4ed8cee3043028587c" Cache-Control: max-age=0 Content-Type: application/json;charset=utf-8
Example of Response Body
The following example shows the contents of the response body, in JSON format.
{ "start": "Publication:1322052581735", "links": [ { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation?navigationDepth=1&fields=SiteNavigation(name)&assetDepth=0", "rel": "self", "templated": false, "mediaType": "", "method": "", "profile": "" }, { "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation?navigationDepth=1&fields=SiteNavigation(name)&assetDepth=0", "rel": "canonical", "templated": false, "mediaType": "", "method": "", "profile": "" }, { "href": "http://<host>:<port>/<context>/REST/resources/v1/metadata-catalog/aggregates/avisports/navigation", "rel": "describedby", "templated": false, "mediaType": "application/schema+json", "method": "GET", "profile": "" } ], "Publication:1322052581735": { "children": [ { "SiteNavigation:1052581735": { "name": "Default", "parents": [] }, "start": "SiteNavigation:1052581735" }, { "start": "SiteNavigation:1346041992371", "SiteNavigation:1346041992371": { "name": "Touch", "parents": [] } }, { "start": "SiteNavigation:1346041992593", "SiteNavigation:1346041992593": { "name": "NonTouch", "parents": [] } } ], "id": "1322052581735", "type": "Publication" } }