Menus

Menus can be used an element of call-flow to allow for a recording to be played and then input received. The input can then be processed according to the rules contained in the menu. It also allows for replaying menus on timeout or error entries.

URI

  • v1/accounts/{account_id}/menus
Property
Description
Validation
Modifiable
retries The number of times to reply the menu if no input is received or it is invalid   yes
timeout The amount of time to wait for input   yes
hunt Allow the caller to directly dial numbers with the menu's realm boolean yes
hunt_deny A blacklist of numbers when hunting regular_expression yes
hunt_allow A whitelist of numbers when hunting regular_expression yes
max_extension_length The maximum number of digits that can be dialed in the menu   yes
record_pin Pin number that if dialed records the menu prompt   yes
Verb
Accepted
Returned
Description
GET   [data:{id},..] Fetches a summary of the menus
PUT ANY ALL Create a new menu
  • Normal Response Code(s): 200
  • Error Response Code(s): 400, 401, 415, 500, 503, 504

URI

  • v1/accounts/{account_id}/menus/{menu_id}
Property
Description
Validation
Modifiable
retries The number of times to reply the menu if no input is received or it is invalid   yes
timeout The amount of time to wait for input   yes
hunt Allow the caller to directly dial numbers with the menu's realm boolean yes
hunt_deny A blacklist of numbers when hunting regular_expression yes
hunt_allow A whitelist of numbers when hunting regular_expression yes
max_extension_length The maximum number of digits that can be dialed in the menu   yes
record_pin Pin number that if dialed records the menu prompt   yes
Verb
Accepted
Returned
Description
GET   ALL Fetch the details of a menu
POST ANY ALL Update the parameters of a menu
DELETE     Delete a menu

Normal Response Code(s): 200, 201

Error Response Code(s): 400, 401, 404, 415, 500, 503, 504

Property
Description
Validation
Modifiable
id The menu ID to execute required yes
{
"module":"menu",
"data": {
"id": "xyz987"
},
"children": {
"1": {
"module": "ring_group",
"data": {
"endpoints": [
{
"id": "xyz654"
},
{
"id": "xyz321",
"delay": 9
}
]
},
"children": {
"_": {
"module": "voicemail",
"data": {
"id": "abc123"
},
"children": {
}
}
}
},
"2": {
"module": "device",
"data": {
"id": "xyz654"
},
"children": {
"_": {
"module": "voicemail",
"data": {
"id": "abc456"
},
"children": {
}
}
}
},
"3": {
"module": "device",
"data": {
"id": "xyz31"
},
"children": {
"_": {
"module": "voicemail",
"data": {
"id": "abc978"
},
"children": {
}
}
}
},
"_": {
"module": "voicemail",
"data": {
"id": "abc123"
},
"children": {
}
}
}
}
METHOD
Request URI
Request Headers
Request Body
Response Body
Response Headers
GET v1/accounts/{account_id}/menus X-Auth-Token: abc123
Accept: application/json
 
{
"auth_token":"abc123",
"status":"success",
"data":[
{
"id":"xyz987"
}
]
}
200 OK
Content-Type: application/json
PUT v1/accounts/{account_id}/menus X-Auth-Token: abc123
Accept: application/json
Content-Type: application/json
{
"data":{
"retries": 3,
"timeout":"10000",
"hunt":true,
"hunt_deny":"2[0-9]{2}",
"max_extension_length":"4",
"record_pin":"9876"
}
}
  201 OK
Location: v1/accounts/{account_id}/menus/{menu_id}
GET v1/accounts/{account_id}/menus/{menu_id} X-Auth-Token: abc123
Accept: application/json
 
{
"auth_token":"abc123",
"status":"success",
"data":{
"retries": 3,
"timeout":"10000",
"hunt":true,
"hunt_deny":"2[0-9]{2}",
"max_extension_length":"4",
"record_pin":"9876"
}
}
200 OK
POST v1/accounts/{account_id}/menus/{menu_id} X-Auth-Token: abc123
Accept: application/json
Content-Type: application/json
{
"data":{
"retries": 3,
"timeout":"10000",
"hunt":true,
"hunt_allow":"1[0-9]{2}",
"max_extension_length":"4",
"record_pin":""
}
}
{
"auth_token":"abc123",
"status":"success",
"data":{
"retries": 3,
"timeout":"10000",
"hunt":true,
"hunt_allow":"1[0-9]{2}",
"max_extension_length":"4",
"record_pin":""
}
}
200 OK
DELETE v1/accounts/{account_id}/menus/{menu_id} X-Auth-Token: abc123
Accept: application/json
 
{
"auth_token":"abc123",
"status":"success",
"data":[]
}
200 OK