Choose your language:
    List all menu items
    Query parameters
    filter  object  Optional
    Returns
    Returns an array of menu_item objects.

    Examples

    Example code:
    const SiteClient = require('datocms-client').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    client.menuItems.all({
    filter: {
    ids: '42,554'
    }
    })
    .then((menuItems) => {
    menuItems.forEach((menuItem) => {
    console.log(menuItem);
    });
    })
    .catch((error) => {
    console.error(error);
    });
    Returned output:
    > node example.js
    {
    "id": "34",
    "label": "Posts",
    "externalUrl": "",
    "position": 1,
    "openInNewTab": true,
    "itemType": "44",
    "parent": null,
    "children": [
    "34"
    ]
    }