Menus

Read-only endpoint providing a hierarchical tree of menu nodes, to be used for building navigation menus. Based on MxCategories

Fields

id

Primary key of the node

name

Display name of the node

SEO identifier for the node. This allows you to link to a category in a more SEO friendly way on your mainsite without needing to look up the numeric id of your category.

tree(root only)

URL to the actual menu listing. This will only be show for the List endpoint.

an array of nodes. This will only show up in the Retrieve endpoint.

Endpoints

List

GET /api/menus/

Return a list of root MxCategory nodes for Menu Trees.

[
    {
        "id": 2,
        "name": "Featured Products",
        "seo_link": "featured-products",
        "tree": "https://demo.itemextend.com/api/menus/2/"
    },
    {
        "id": 4,
        "name": "menu-v1",
        "seo_link": "menuv1",
        "tree": "https://demo.itemextend.com/api/menus/4/"
    },
    {
        "id": 3,
        "name": "New Products",
        "seo_link": "new-products",
        "tree": "https://demo.itemextend.com/api/menus/3/"
    }
]

Retrieve

GET /api/menus/:key/

GET /api/menus/:seo_url/ 

Return a nested representation of the Menu Tree with the requested MXCategory as the root node. The node may be retrieved by primary key or seo_link. An optional depth parameter may be used to limit the depth of the tree returned.

It is recommended that you try caching the menu calls client side, as the SQL call for this is very intensive.

[
  {
    "id":100,
    "name":"Thing We Sell",
    "seo_link":"thing-we-sell",
    "menus":[
      {
        "id":442,
        "name":"Pink Towels",
        "seo_link":"pink-towels",
        "menus":[]
      },
      {
        "id":443,
        "name":"Red Towels",
        "seo_link":"red-towels",
        "menus":[]
      },
      {
        "id":444,
        "name":"Blue Towels",
        "seo_link":"blue-towels",
        "menus":[]
      }
    ]
  }
]