Previous Next

Get the navigation by node identifier

get
/resources/v1/aggregates/{siteName}/navigation/{nodeIdentifier}
The resource endpoint returns the navigation data for a given node identifier in a site name.

Important Note: It is a Singular Resource. The response is in an aggregated asset format (refer to the 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
nodeIdentifier Site node ID or the site navigation name integer double
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 are to be returned. The default node type is placed. This is applicable only for a publication node (that is, nodeIdentifier is a publication ID).
Usage:
  • "code=unplaced". It means to include only unplaced children in the response.
  • "code=placed,unplaced". It means to include both placed and unplaced children in the response.
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 1

The following example shows how to get all immediate child page names and IDs under the Home Page of the avisports sample site in WebCenter Sites, by submitting a GET request on the REST resource using cURL.

Query param details:

  • "navigationDepth=1": We are interested only in immediate children.

  • "assetDepth=0&fields=Page(name,id)": All children are available in a 'children' array. Each child (Page) is an aggregated asset. We are interested only in the names of children.

curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation/1327351719456?navigationDepth=1&assetDepth=0&fields=Page(name,id)"

Example 1 Response Header

The following example shows the response header.

HTTP/1.1 200 OK
ETag: "ca4e0e90bb39936eaa6681b2a8c44bdf2933a84e06faae275f28e7378e204f04"
Cache-Control: max-age=0
Content-Type: application/json;charset=utf-8

Example 1 Response Body

The following example shows the contents of the response body, in JSON format.

{
  "start": "Page:1327351719456",
  "links": [
    {
      "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation/1327351719456?navigationDepth=1&fields=Page(name,id)&assetDepth=0",
      "rel": "self",
      "templated": false,
      "mediaType": "",
      "method": "",
      "profile": ""
    },
    {
      "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation/1327351719456?navigationDepth=1&fields=Page(name,id)&assetDepth=0",
      "rel": "canonical",
      "templated": false,
      "mediaType": "",
      "method": "",
      "profile": ""
    },
    {
      "href": "http://<host>:<port>/<context>/REST/resources/v1/metadata-catalog/aggregates/avisports/navigation/1327351719456",
      "rel": "describedby",
      "templated": false,
      "mediaType": "application/schema+json",
      "method": "GET",
      "profile": ""
    }
  ],
  "Page:1327351719456": {
    "name": "Home",
    "id": 1327351719456,
    "children": [
      {
        "Page:1329851332601": {
          "name": "Surfing",
          "id": 1329851332601,
          "parents": []
        },
        "start": "Page:1329851332601"
      },
      {
        "Page:1329326970440": {
          "name": "Skiing",
          "id": 1329326970440,
          "parents": []
        },
        "start": "Page:1329326970440"
      },
      {
        "Page:1361217259137": {
          "name": "Running",
          "id": 1361217259137,
          "parents": []
        },
        "start": "Page:1361217259137"
      },
      {
        "start": "Page:1327351719467",
        "Page:1327351719467": {
          "name": "Tennis",
          "id": 1327351719467,
          "parents": []
        }
      },
      {
        "start": "Page:1327351719525",
        "Page:1327351719525": {
          "name": "Baseball",
          "id": 1327351719525,
          "parents": []
        }
      }
    ],
    "parents": []
  }
}

Example 2

The following example shows how to get all child page names hierarchically under the default siteNavigation of the avisports sample site in WebCenter Sites, by submitting a GET request on the REST resource using cURL.

Query param details:

  • "navigationDepth=all": We are interested in all children in the hierarchy.

  • "assetDepth=0&fields=SiteNavigation(name)": All children are available in a 'children' array. Each child (Page) is an aggregated asset. We are interested only in the names of children.

curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation/default?navigationDepth=all&assetDepth=0&fields=SiteNavigation(name);Page(name)"

Example 2 Response Header

The following example shows the response header.

HTTP/1.1 200 OK
ETag: "231b40a9fcbc77e9b6db18fe8fd87a5a4c552ff54ad5d291cdd6c8a811337529"
Cache-Control: max-age=0
Content-Type: application/json;charset=utf-8

Example 2 Response Body

The following example shows the contents of the response body, in JSON format.

{
  "start": "SiteNavigation:1052581735",
  "links": [
    {
      "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation/default?navigationDepth=all&fields=SiteNavigation(name);Page(name)&assetDepth=0",
      "rel": "self",
      "templated": false,
      "mediaType": "",
      "method": "",
      "profile": ""
    },
    {
      "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/navigation/default?navigationDepth=all&fields=SiteNavigation(name);Page(name)&assetDepth=0",
      "rel": "canonical",
      "templated": false,
      "mediaType": "",
      "method": "",
      "profile": ""
    },
    {
      "href": "http://<host>:<port>/<context>/REST/resources/v1/metadata-catalog/aggregates/avisports/navigation/default",
      "rel": "describedby",
      "templated": false,
      "mediaType": "application/schema+json",
      "method": "GET",
      "profile": ""
    }
  ],
  "SiteNavigation:1052581735": {
    "name": "Default",
    "children": [
      {
        "start": "Page:1327351719456",
        "Page:1327351719456": {
          "name": "Home",
          "children": [
            {
              "Page:1329851332601": {
                "name": "Surfing",
                "parents": []
              },
              "start": "Page:1329851332601"
            },
            {
              "Page:1329326970440": {
                "name": "Skiing",
                "parents": []
              },
              "start": "Page:1329326970440"
            },
            {
              "Page:1361217259137": {
                "name": "Running",
                "parents": []
              },
              "start": "Page:1361217259137"
            },
            {
              "start": "Page:1327351719467",
              "Page:1327351719467": {
                "name": "Tennis",
                "parents": []
              }
            },
            {
              "start": "Page:1327351719525",
              "Page:1327351719525": {
                "name": "Baseball",
                "parents": []
              }
            }
          ],
          "parents": []
        }
      }
    ],
    "parents": []
  }
}