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 FXS channel, extension, extension group, organization list, trunk, user role, phonebook, group voicemail, IVR, ring group, queue, queue agent, conference, and PIN list.

Request URL

GET {base_url}/{api_path}/system/get_menuoptions?access_token={access_token}

Request parameters

Table 1.
Parameter Required Type Description
menu Yes String The menu that you want to query.

Valid value:

  • fxs: FXS channel.
  • extension: Extension.
  • ext_group: Extension group.
  • org_list: Organization list.
  • trunk: Trunk.
  • role: User role.
  • phonebook: Phonebook.
  • group_vm: Group voicemail.
  • IVR: IVR.
  • ring_group: Ring group.
  • queue: Queue.
  • queue_agent: Queue agent.
  • conference: Conference.
  • pinset: PIN list.
id No Integer
The unique ID of the queue.
Note: This parameter is required when querying the agents included in a queue.

Response parameters

Table 2.
Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
data Array<Options> The information of the menu options.
Options
Table 3.
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 only returned when querying organization list.
Sub_Org
Table 4.
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"
                    }
                ]
            }
        ]
    }