API Reference

Elements

The links inside a menu, nested through their parent element.

Prefix /cdna-api/menus ReferenceElement model GuideCustom fields
Elements in Postman

List menu elements#

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

Lists menu elements. Without limit every match comes back.

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

Parameters

menu.idpathrequired
integer
The menu id.
propertiesquery
selector
The fields and relations to return, such as {id,name,type,position}.
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 menu elements
GET /cdna-api/menus/elements/1?limit=2&properties={id,name,type,position} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 11,
  "data": [
    {
      "id": 1,
      "name": "User Docs",
      "type": "url",
      "position": 1
    },
    {
      "id": 2,
      "name": "Developer Docs",
      "type": "url",
      "position": 2
    }
  ]
}
Open in Postman docs Real response from this documentation site

Show a menu element#

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

Reads one menu element by its id.

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

Parameters

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

Example

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

Create a menu element#

POST /cdna-api/menus/element/{menu.id}

Creates a menu element.

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

Parameters

menu.idpathrequired
integer
The menu id.
namebody
string
The name.
typebody
string
What the element is: url, entity for a record (with entity and recordId), controller, or text for a label with no link.

Example

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

{
  "name": "New menu element",
  "type": "text"
}
Response 200 OK
{
  "result": "success",
  "data": {
    "element": {
      "id": 80,
      "name": "New menu element",
      "type": "text",
      "url": null,
      "controllerName": null,
      "controller": null,
      "moduleRoute": null,
      "controllerRoute": null,
      "responseVariable": null,
      "includeChildren": null
    }
  },
  "message": "The Menu Element has been added successfully."
}
Open in Postman docs Saved response from the Postman collection, shortened

Edit a menu element#

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

Changes a menu element. 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 element id.
namebody
string
The name.
typebody
string
What the element is: url, entity for a record (with entity and recordId), controller, or text for a label with no link.
urlbody
string
The URL.

Example

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

{
  "name": "Changed to URL",
  "type": "url",
  "url": "https://www.google.com"
}
Response 200 OK
{
  "result": "success",
  "data": {
    "element": {
      "id": 80,
      "name": "Changed to URL",
      "type": "url",
      "url": "https://www.google.com",
      "controllerName": null,
      "controller": null,
      "moduleRoute": null,
      "controllerRoute": null,
      "responseVariable": null,
      "includeChildren": null
    }
  },
  "message": "The Menu Element has been saved successfully."
}
Open in Postman docs Saved response from the Postman collection, shortened

Delete a menu element#

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

Deletes a menu element.

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

Parameters

idpathrequired
integer
The menu element id.

Example

Delete a menu element
DELETE /cdna-api/menus/element/80 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Move an element#

PUT /cdna-api/menus/element/move/{id}

Moves an element to a new place: under another parent (null for the top level) at a position from 1. The elements around it shift to make room, and close up where it left. To move it to another menu, send menu too.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The saved element under data.element, and a message.

Parameters

idpathrequired
integer
The element id.
parentbody
integer
The new parent element; null for the top level.
positionbody
integer
Its place among its new siblings, from 1.
menubody
integer
The menu, when it moves to another.

Example

Move an element
PUT /cdna-api/menus/element/move/53 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "parent": 21,
  "position": 1
}