API ReferenceContent

Menus

Menus, the named trees of links that templates read, and the elements inside them.

Prefix /cdna-api/menus ReferenceMenu model
Menus in Postman

About menus

A menu is a named tree of elements. Templates find a menu by its exact name, so the name is part of the site’s contract. Elements nest through a parent and point at a URL, a record or a controller.

Hierarchy Elements

Elements nest under a parent element; the menu holds the root elements.

The built-in content types
Custom fields Yes

Menus and elements take custom fields, which templates read per element.

Custom fields
Revisions No

Menus and elements are not versioned; a change applies at once.

Revisions, publishing and approval

List menus#

GET /cdna-api/menus/menus

Lists menus. Without limit every match comes back.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Menu, in the Reference

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,name}.
filtersquery
name=value
Any stored field, or a relation with a dot, such as parent.id=12. Prefix the name with !, >, <, % or |. Use stored field names exactly as in the model, and compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List menus
GET /cdna-api/menus/menus?limit=2&properties={id,name} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 5,
  "data": [
    {
      "id": 1,
      "name": "Header Menu"
    },
    {
      "id": 2,
      "name": "Footer Menu"
    }
  ]
}
Open in Postman docs Real response from this documentation site

Show a menu#

GET /cdna-api/menus/menu/{id}

Reads one menu by its id.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Menu, in the Reference

Parameters

idpathrequired
integer
The menu id.
propertiesquery
selector
The fields and relations to return, such as {id,name}.

Example

Show a menu
GET /cdna-api/menus/menu/1?properties={id,name} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 1,
    "name": "Header Menu"
  }
}
Open in Postman docs Real response from this documentation site

Create a menu#

POST /cdna-api/menus/menu

Creates a menu.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

namebody
string
The name.

Example

Create a menu
POST /cdna-api/menus/menu HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "name": "New menu from API"
}
Response 200 OK
{
  "result": "success",
  "data": {
    "menu": {
      "rootElements": [],
      "id": 11,
      "name": "New menu from API",
      "created": "2020-04-30T17:03:35+00:00",
      "modified": "2020-04-30T17:03:35+00:00",
      "elements": [],
      "customFieldValues": [],
      "customFields": []
    }
  },
  "message": "The Menu has been added successfully."
}
Open in Postman docs Saved response from the Postman collection

Edit a menu#

PUT /cdna-api/menus/menu/{id}

Changes a menu. Fields left out keep their values.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The menu id.
namebody
string
The name.

Example

Edit a menu
PUT /cdna-api/menus/menu/11 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "name": "Changed menu title from API"
}
Response 200 OK
{
  "result": "success",
  "data": {
    "menu": {
      "rootElements": [],
      "id": 11,
      "name": "Changed menu title from API",
      "created": "2020-04-30T17:03:35+00:00",
      "modified": "2020-04-30T17:05:23+00:00",
      "elements": [],
      "customFieldValues": [],
      "customFields": []
    }
  },
  "message": "The Menu has been saved successfully."
}
Open in Postman docs Saved response from the Postman collection

Delete a menu#

DELETE /cdna-api/menus/menu/{id}

Deletes a menu.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The menu id.

Example

Delete a menu
DELETE /cdna-api/menus/menu/11 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": [],
  "message": "The Menu has successfully been deleted."
}
Open in Postman docs Saved response from the Postman collection

In Menus