JSON API » plans » plans/routes/create
Creates a new rate plan route.
Input parameters
Requires authentication and the commerce role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
plan | Integer | ID of rate plan. | Yes | |
prefix | String | Prefix of route. | Yes | |
allow | Integer | Whether to allow calls. 0 to forbid, 1 to allow, 2 to allow if time group is active, 3 to allow if timegroup is not active. | No | 1 |
description | String | Description. | No | Empty string. |
media | String | Media type. "fax", "voice", or "voice_fax". | No | "voice_fax" |
peer1 | Integer | ID of first peer to route to. 0 for default, -1 for least cost. | No | 0 |
peer2 | Integer | ID of second peer to route to. 0 for none, -1 for least cost. | No | 0 |
peer3 | Integer | ID of third peer to route to. 0 for none, -1 for least cost. | No | 0 |
validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Responses
Code | Description |
---|---|
201 | Input passed validation. Only returned if validation=1. |
204 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your rate plan does not allow this. |
Data returned
No data is returned.
Example: With required parameters
http://enswitch.example.com/api/json/plans/routes/create/?auth_username=user;auth_password=password;plan=2;prefix=011{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
Version | Changes |
---|---|
3.13 | Function added. |