Get Menu Options
Query the menu option details when creating and updating features.
Background information
When creating and updating features, you can use the interface to query the menu options of desired features. The interface supports to query the option details (ID, name, or type) of specific features including extension, extension group, organization, trunk, user role, phonebook, group voicemail, IVR, call flow, ring group, queue, queue agent, conference, PIN list, system prompt, custom prompt, certificates, AI receptionist, etc.
Request URL
GET {base_url}/{api_path}/system/get_menuoptions?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| menu | Yes | String | The menu that you want to query. Valid value:
|
| id | No | Integer | The unique ID of the queue.Note:This parameter is required when querying the agents included in a queue. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
|
| errmsg | String | Returned message.
|
| data | Array<Options> | The information of the menu options. |
Options
| Parameter | Type | Description |
|---|---|---|
| text | String | The name of the menu options. |
| value | String | The ID of the menu options. For example, when the menu is trunk, the value displays the trunk ID. |
| type | String | The type of the menu options. For example, when the menu is trunk, the type displays the trunk type. |
| item | Array<Sub_Org> | The information of the sub-organization.Note:This parameter is returned only when querying organization list. |
Sub_Org
| Parameter | Type | Description |
|---|---|---|
| text | String | The name of the sub-organization. |
| value | String | The ID of the sub-organization. |
Examples
Example 1: Query the menu options of user role.
Request example
GET /openapi/v1.0/system/get_menuoptions?access_token=ImvFJSbT9DUi9iQpssHgIlQgC2pb5ZHB&menu=role Host: 192.168.5.150:8088
Response example
HTTP/1.1 200 OK { "errcode": 0, "errmsg": "SUCCESS", "data": [ { "text": "None", "value": "0" }, { "text": "Administrator", "value": "1" }, { "text": "Supervisor", "value": "2" }, { "text": "Operator", "value": "3" }, { "text": "Employee", "value": "4" }, { "text": "Human Resource", "value": "5" }, { "text": "Accounting", "value": "6" } ] }Example 2: Query the menu options of organization.
Request example
GET /openapi/v1.0/system/get_menuoptions?access_token=sIqNaNz22Ph0HKLp25m1aYJJVUbhHyOP&menu=org_list HTTP/1.1 Host: 192.168.5.150:8088
Response example
HTTP/1.1 200 OK { "errcode": 0, "errmsg": "SUCCESS", "data": [ { "text": "Yeastar", "value": "1", "item": [ { "text": "Tech support", "value": "2" }, { "text": "Sales", "value": "3" } ] } ] }