Menu items
Use these methods to customize the menu displayed to your clients in the B2Core UI.
GET[host]/api/v2/menus |
|
GET[host]/api/v2/menus/{menuId} |
|
PUT[host]/api/v2/menus/{menuId} PATCH[host]/api/v2/menus/{menuId} |
Get a menu tree
Use this method to get a menu tree configured in the Back Office.
To obtain detailed information about a specific menu item, use a separate method to get menu item details.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
- deep
If
true
, a full menu tree is returned.If
false
(the default value), only direct child items of the root menu item are returned.
The following filter parameters are available for this method:
- menuId
The menu item identifier.
- new
If
true
, a menu item is marked as new in the B2Core UI; otherwise,false
.- caption
The menu item name displayed to clients in the B2Core UI.
- rootName
The name of a root menu item.
This filter parameter is ignored if the
menuId
parameter is specified.- verificationLevelId
The identifier of a verification level indicating that a menu item is only displayed to the clients that have obtained the specified verification level.
- visible
If
true
, a menu item is displayed to clients in the B2Core UI; otherwise,false
.
The following sorting parameters are available for this method:
- priority (default)
The priority index assigned to a menu item.
- name
The menu item name used in the Back Office.
- caption
The menu item name displayed to clients in the B2Core UI.
GET[host]/api/v2/menus
curl --location -g --request GET 'https://host.name/api/v2/menus?sort_order=desc&deep=false&filter[menuId]=1&filter[new]=true&filter[caption]=dashboard&filter[rootName]=general&filter[verificationLevelId]=1&filter[visible]=true&sort_by=priority' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes an array of Menu Item objects providing information about the menu items matching the request parameters.
Get menu item details
Use this method to obtain detailed information about a specified menu item.
To obtain a menu tree, use a separate method to get a menu tree.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- menuId required
The menu item identifier.
GET[host]/api/v2/menus/{menuId}
curl --location --request GET 'https://host.name/api/v2/menus/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes a Menu Item object providing information about the specified menu item.
Update a menu item
Use this method to update a specified menu item.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- menuId required
The menu item identifier.
Body:
The following field values can be updated for a specified menu item:
- caption string
The menu item name displayed to clients in the B2Core UI.
- verificationLevelIds array
An array of integer values indicating that a menu item is only displayed to the clients that have obtained the specified verification levels.
- clientTypeIds array
An array of integer values indicating that a menu item is only displayed to clients that are assigned the specified types.
- new boolean
If
true
, a menu item is marked as new in the B2Core UI; otherwise,false
.- visible boolean
If
true
, a menu item is displayed to clients in the B2Core UI; otherwise,false
.- priority integer
The priority index assigned to a menu item.
PUT[host]/api/v2/menus/{menuId}
curl --location --request PUT 'https://host.name/api/v2/menus/2' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"caption": "Dashboard",
"verificationLevelIds": [
1,
2
],
"clientTypeIds": [
1,
2
],
"new": false,
"visible": false,
"priority": 2
}'
Response
A response includes a Menu Item object providing information about the menu item that was updated.