JSON API » plans » plans/routes/update

Updates an existing 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.NoCurrent value.
descriptionStringDescription.NoCurrent value.
mediaStringMedia type. "fax", "voice", or "voice_fax".Yes
peer1IntegerID of first peer to route to. 0 for default, -1 for least cost.NoCurrent value.
peer2IntegerID of second peer to route to. 0 for none, -1 for least cost.NoCurrent value.
peer3IntegerID of third peer to route to. 0 for none, -1 for least cost.NoCurrent value.
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
204Success.
201Input passed validation. Only returned if validation=1.
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.
404The plan route does not exist, or you do not have permission to view it.

Data returned

No data is returned.

Example: Changing the first peer

http://enswitch.example.com/api/json/plans/routes/update/?auth_username=user;auth_password=password;plan=2;prefix=011;peer1=123;media=voice_fax

{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }

Change history

VersionChanges
3.13Function added.