Definition

A menu defines a tree structure of menu items, which are composed of a text label, a link, and optionally a map of properties (key-value pairs) that can be used to generate various kinds of navigation menus. This can be used to define data for top-navigation, side-navigation, or other similar hierarchies of internal document links or external web links.

The main menu endpoint in the Site Management API treats a menu structure as a single entity and only manages the top-level menu.

At API level, a menu is therefore represented by a single string holding its name:

main

There is a specific endpoint to manage the nested items of a menu, although they can also be managed by site editors in the Experience manager app.

The API represents a list of top-level menu items (which contain nested items themselves):

[
  {
    "name": "About Us",
    "link": "about-us",
    "properties": {
      "propname2": "propvalue2",
      "propname": "propvalue"
    },
    "items": [
      {
        "name": "Contact Information",
        "link": "contact",
        "properties": {
          "propname2": "propvalue22222"
        }
      },
      {
        "name": "Careers",
        "link": "http://jobs.com/companyX",
        "properties": {
          "propname": "propvalue11111"
        }
      }
    ]
  }
]

There is another endpoint to manage the prototype properties of a menu. When using the API, each item directly specifies its properties, however, items created through the Experience manager, are initialized with the properties from the prototype.

The format of these properties is a map of property name and value.

{
  "property1": "propValue1",
  "property2": "propValue2"
}

Operations

Developers can retrieve a list of menus, retrieve the name of a menu, create a menu, and delete a menu. They can also edit the prototype properties of a menu, or its items.

See Channel Menu Operations in the Site Management API reference documentation for a list of operations.

You can find examples of using the menu endpoints in the Postman collection.


Did this page help you?