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
idIntegerID of rate plan route to update.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.
called_prefixStringCalled prefix to match.NoCurrent value.
caller_prefixStringCallerid prefix to match. Empty string for any.NoCurrent value.
descriptionStringDescription.NoCurrent value.
mediaStringMedia type. "fax", "voice", or "voice_fax".NoCurrent value.
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.NoCurrent value.

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 rate plan route does not exist, or you do not have permission to update 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;id=1;peer1=123

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

Change history

VersionChanges
4.1prefix input parameter renamed to called_prefix. id and caller_prefix input parameters added. plan input parameter removed.
3.13Function added.