PUT api/menu

Saves user's menu layout. If a menu layout for the user already exists for a given application and the company they are logged on to the old one is deleted. Applications that the user doesn't have access to via their Web token are stored nevertheless, but are automatically stripped from the list during the fetching phase. The order of menu items within a menu, and submenu items within menu items, is persisted as well.

Request Information

URI Parameters

None.

Body Parameters

User's menu layout to store.

MenuDTO
NameDescriptionTypeAdditional information
NumberOfItemsLeft

Number of items positioned on the left in the menu.

integer

None.

ApplicationType

Application name that the menu layout is for. E.g. "CPP", "Retail" etc.

string

None.

MenuItems

A collection of menu items for the menu.

Collection of MenuItemDTO

None.

Request Formats

application/json, text/json

Sample:
{
  "NumberOfItemsLeft": 1,
  "ApplicationType": "sample string 2",
  "MenuItems": [
    {
      "href": "sample string 1",
      "translateTag": "sample string 2",
      "klasa": "sample string 3",
      "submenuItems": [
        {
          "href": "sample string 1",
          "translateTag": "sample string 2"
        },
        {
          "href": "sample string 1",
          "translateTag": "sample string 2"
        }
      ]
    },
    {
      "href": "sample string 1",
      "translateTag": "sample string 2",
      "klasa": "sample string 3",
      "submenuItems": [
        {
          "href": "sample string 1",
          "translateTag": "sample string 2"
        },
        {
          "href": "sample string 1",
          "translateTag": "sample string 2"
        }
      ]
    }
  ]
}

text/html

Sample:
{"NumberOfItemsLeft":1,"ApplicationType":"sample string 2","MenuItems":[{"href":"sample string 1","translateTag":"sample string 2","klasa":"sample string 3","submenuItems":[{"href":"sample string 1","translateTag":"sample string 2"},{"href":"sample string 1","translateTag":"sample string 2"}]},{"href":"sample string 1","translateTag":"sample string 2","klasa":"sample string 3","submenuItems":[{"href":"sample string 1","translateTag":"sample string 2"},{"href":"sample string 1","translateTag":"sample string 2"}]}]}

application/xml, text/xml

Sample:
<MenuDTO xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Common.WebAPI.DTOs">
  <ApplicationType>sample string 2</ApplicationType>
  <MenuItems>
    <MenuItemDTO>
      <href>sample string 1</href>
      <klasa>sample string 3</klasa>
      <submenuItems>
        <SubmenuItemDTO>
          <href>sample string 1</href>
          <translateTag>sample string 2</translateTag>
        </SubmenuItemDTO>
        <SubmenuItemDTO>
          <href>sample string 1</href>
          <translateTag>sample string 2</translateTag>
        </SubmenuItemDTO>
      </submenuItems>
      <translateTag>sample string 2</translateTag>
    </MenuItemDTO>
    <MenuItemDTO>
      <href>sample string 1</href>
      <klasa>sample string 3</klasa>
      <submenuItems>
        <SubmenuItemDTO>
          <href>sample string 1</href>
          <translateTag>sample string 2</translateTag>
        </SubmenuItemDTO>
        <SubmenuItemDTO>
          <href>sample string 1</href>
          <translateTag>sample string 2</translateTag>
        </SubmenuItemDTO>
      </submenuItems>
      <translateTag>sample string 2</translateTag>
    </MenuItemDTO>
  </MenuItems>
  <NumberOfItemsLeft>1</NumberOfItemsLeft>
</MenuDTO>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'MenuDTO'.

Response Information

Resource Description

The newly stored menu layout DTO.

MenuDTO
NameDescriptionTypeAdditional information
NumberOfItemsLeft

Number of items positioned on the left in the menu.

integer

None.

ApplicationType

Application name that the menu layout is for. E.g. "CPP", "Retail" etc.

string

None.

MenuItems

A collection of menu items for the menu.

Collection of MenuItemDTO

None.

Response Formats

application/json, text/json

Sample:
{
  "NumberOfItemsLeft": 1,
  "ApplicationType": "sample string 2",
  "MenuItems": [
    {
      "href": "sample string 1",
      "translateTag": "sample string 2",
      "klasa": "sample string 3",
      "submenuItems": [
        {
          "href": "sample string 1",
          "translateTag": "sample string 2"
        },
        {
          "href": "sample string 1",
          "translateTag": "sample string 2"
        }
      ]
    },
    {
      "href": "sample string 1",
      "translateTag": "sample string 2",
      "klasa": "sample string 3",
      "submenuItems": [
        {
          "href": "sample string 1",
          "translateTag": "sample string 2"
        },
        {
          "href": "sample string 1",
          "translateTag": "sample string 2"
        }
      ]
    }
  ]
}

text/html

Sample:
{"NumberOfItemsLeft":1,"ApplicationType":"sample string 2","MenuItems":[{"href":"sample string 1","translateTag":"sample string 2","klasa":"sample string 3","submenuItems":[{"href":"sample string 1","translateTag":"sample string 2"},{"href":"sample string 1","translateTag":"sample string 2"}]},{"href":"sample string 1","translateTag":"sample string 2","klasa":"sample string 3","submenuItems":[{"href":"sample string 1","translateTag":"sample string 2"},{"href":"sample string 1","translateTag":"sample string 2"}]}]}

application/xml, text/xml

Sample:
<MenuDTO xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Common.WebAPI.DTOs">
  <ApplicationType>sample string 2</ApplicationType>
  <MenuItems>
    <MenuItemDTO>
      <href>sample string 1</href>
      <klasa>sample string 3</klasa>
      <submenuItems>
        <SubmenuItemDTO>
          <href>sample string 1</href>
          <translateTag>sample string 2</translateTag>
        </SubmenuItemDTO>
        <SubmenuItemDTO>
          <href>sample string 1</href>
          <translateTag>sample string 2</translateTag>
        </SubmenuItemDTO>
      </submenuItems>
      <translateTag>sample string 2</translateTag>
    </MenuItemDTO>
    <MenuItemDTO>
      <href>sample string 1</href>
      <klasa>sample string 3</klasa>
      <submenuItems>
        <SubmenuItemDTO>
          <href>sample string 1</href>
          <translateTag>sample string 2</translateTag>
        </SubmenuItemDTO>
        <SubmenuItemDTO>
          <href>sample string 1</href>
          <translateTag>sample string 2</translateTag>
        </SubmenuItemDTO>
      </submenuItems>
      <translateTag>sample string 2</translateTag>
    </MenuItemDTO>
  </MenuItems>
  <NumberOfItemsLeft>1</NumberOfItemsLeft>
</MenuDTO>