Choose your language:
    Retrieve a menu item
    Returns
    Returns a menu_item object.

    Examples

    Example code:
    const SiteClient = require('datocms-client').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    const menuItemId = '34';
    client.menuItem.find(menuItemId)
    .then((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"
    ]
    }