Add an Outbound Route

Create and configure an outbound route.

Request URL

POST {base_url}/{api_path}/outbound_route/create?access_token={access_token}

Request parameters

Table 1.
Parameter Required Type Description
name Yes String Outbound route name.
outbound_cid No String Outbound caller ID.
dial_pattern_list No Array<Dial_Pattern_List> The dial pattern of the outbound route.
trunk_list No Array<Trunk_List> The selected trunk in the outbound route.
ext_list No Array<Ext_List> The selected extensions in the outbound route.
pin_protect Yes String Outbound route password.
Valid value:
  • disable
  • single_pin
  • pin_list
pin No String Single PIN code.
Note: This parameter is required when the value of pin_protect is set to single_pin.
pin_list No Integer The unique ID of the selected PIN list.
Note:
  • This parameter is required when the value of pin_protect is set to pin_list.
  • You can query the PIN list ID using Get Menu Options.
Dial_Pattern_List
Table 2.
Parameter Required Type Description
pattern No String The dial pattern matching rules.
strip No Integer The number of digits that will be stripped from the beginning of a dialed number before the call is placed.
prepend No String The digits that will be prepended to the phone number before the call is placed.
Trunk_List
Table 3.
Parameter Required Type Description
id Yes Integer The unique ID of the selected trunk.
name No String Trunk name.
type No String Trunk type.
Ext_List
Table 4.
Parameter Required Type Description
id Yes Integer The unique ID of the selected extension/extension group/organization.
Note: You can query the desired ID using Get Menu Options.
ext_number No String Extension number.
ext_name No String The name of the extension/extension group/organization.
type Yes String The type of the selected item.

Valid value:

  • extension
  • ext_group
  • organization

Response parameters

Table 5.
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.
id Integer The unique ID of the outbound route.

Examples

Request example

POST /openapi/v1.0/outbound_route/create?access_token=EKAuoD0jqEYnQoyOJBH0QmN7J9XRCTRq HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
    "name": "test",
    "trunk_list": [ 
       {       
            "id": 27
        }
    ],
    "ext_list": [
        {
            
            "id": 13,
            "type": "organization"
        },
         {
            
            "id": 34,
            "type": "ext_group"
        },
        {
          "id":39,
          "type":"extension"
         }
    ],
    "dial_pattern_list": [
        {
            "pattern": "X.",
            "strip": 0,
            "prepend": ""
        }
    ],
   "pin_protect":"disable"
}

Response example

HTTP 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "id": 15
}