Add an Inbound Route
Add and configure an inbound route.
Request URL
POST {base_url}/{api_path}/inbound_route/create?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| name | Yes | String | The name of the inbound route. |
| alert_info | No | String | Inbound alert info. |
| did_option | No | String | DID matching mode. Valid value:
|
| did_pattern_list | No | Array<DID_Pattern_List> | The DID matching pattern list.Note:This parameter is required when the did_option is patterns. |
| did_pattern_to_ext | No | String | The DID pattern matching to extensions.Note:This parameter is required when the did_option is pattern_to_ext. |
| did_to_ext_start | No | String | The start number of the DID matching pattern range.Note:This parameter is required when the did_option is range_to_ext. |
| did_to_ext_end | No | String | The end number of the DID matching pattern range.Note:This parameter is required when the did_option is range_to_ext. |
| did_pattern_to_ext_list | No | Array<DID_Pattern_Ext_List> | The list of DID numbers and the corresponding extensions.Note:This parameter is required when the did_option is pattern_to_ext_list. |
| cid_option | No | String | The Caller ID matching pattern. Valid value:
|
| cid_pattern_list | No | Array<CID_Pattern_List> | The Caller ID matching pattern list.Note:This parameter is required when the cid_option is patterns. |
| cid_to_phonebook | No | Array<Integer> | The ID(s) of the selected phonebook(s).Note:
|
| trunk_list | Yes | Array<Trunk_List> | The list of the selected trunk in the inbound route. |
| def_dest | Yes | String | Default destination.
|
| def_dest_prefix | No | String | This parameter defines different settings depending on the value of def_dest.
|
| def_dest_value | No | String | This parameter defines different settings depending on the value of def_dest.
|
| def_dest_ext_list | No | Array<Ext_List> | The list of selected extensions/extension groups.Note:This parameter is required when the def_dest is set to pattern_to_ext. |
| ringback_tone | No | String | The filename of custom prompt (e.g. demo.wav) played for the caller before the extension user answers the call.Note:
|
DID_Pattern_List
| Parameter | Required | Type | Description |
|---|---|---|---|
| did_pattern | Yes | String | DID matching patten rule. |
DID_Pattern_Ext_List
| Parameter | Required | Type | Description |
|---|---|---|---|
| did_pattern | Yes | String | The specific DID number. |
| did_pattern_to_ext | Yes | String | The unique ID of the extension that corresponds to the DID number.Note:You can query the extension's ID using Search Specific Extensions. |
CID_Pattern_List
| Parameter | Required | Type | Description |
|---|---|---|---|
| cid_pattern | Yes | String | Caller ID matching pattern rule. |
Trunk_List
| Parameter | Required | Type | Description |
|---|---|---|---|
| id | Yes | Integer | The unique ID of the selected trunk.Note:You can query the trunk's ID using Search Specific Trunks. |
| name | No | String | Trunk name. |
| type | No | String | Trunk type. |
Ext_List
| Parameter | Required | Type | Description |
|---|---|---|---|
| value | Yes | String | The unique ID of the extension/extension group.Note:
|
| name | No | String | The name of the extension/extension group. |
| number | No | String | Extension number. |
| type | No | String | The type of the selected item. Valid value:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
|
| errmsg | String | Returned message.
|
| id | Integer | The unique ID of the inbound route. |
Examples
Request example
POST /openapi/v1.0/inbound_route/create?access_token=Rka0iV0BJUVTXj1EYpwbg2YUkODdw22N HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
"name": "test",
"did_option":"pattern_to_ext",
"did_pattern_to_ext": "550330{{.Ext}}",
"cid_option":"phonebook",
"cid_to_phonebook":[8,10],
"trunk_list":[{"id":28}],
"def_dest":"pattern_to_ext",
"def_dest_ext_list":[{"value":"39"},{"value":"67","type":"ext_group"}]
}Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"id": 15
}