JSON API » plans » plans/routes/create

Creates a new rate plan route.

Input parameters

Requires authentication and the commerce role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
planIntegerID of rate plan.Yes
prefixStringPrefix of route.Yes
allowIntegerWhether 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.No1
descriptionStringDescription.NoEmpty string.
mediaStringMedia type. "fax", "voice", or "voice_fax".No"voice_fax"
peer1IntegerID of first peer to route to. 0 for default, -1 for least cost.No0
peer2IntegerID of second peer to route to. 0 for none, -1 for least cost.No0
peer3IntegerID of third peer to route to. 0 for none, -1 for least cost.No0
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
201Input passed validation. Only returned if validation=1.
204Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your 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

VersionChanges
3.13Function added.