JSON API » routes » routes/update

Updates an existing route.

Input parameters

Requires authentication and the system role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
idIntegerID of route to update.Yes
allow_plan_peersInteger1 to allow rate plans to override this route, 0 not to.NoCurrent value.
called_maxIntegerMaximum length of called number to match.NoCurrent value.
called_minIntegerMinimum length of called number to match.NoCurrent value.
called_prefixStringCalled prefix to match.NoCurrent value.
caller_prefixStringCallerid prefix to match. Empty string for any.NoCurrent value.
copy_costs_peerIntegerIf any of the peers have no costs for the outbound group, copy costs from the peer with this ID. 0 to disable. Has no effect for least cost peers.No0
descriptionStringDescription.NoCurrent value.
mediaStringMedia type to match. "voice_fax" for voice or fax, "voice", "fax", or "message".NoCurrent value.
outgroupIntegerID of outbound group.NoCurrent value.
peer1IntegerID of first peer to try. -1 for least cost.NoCurrent value.
peer2IntegerID of second peer to try. -1 for least cost. 0 for none.NoCurrent value.
peer3IntegerID of third peer to try. -1 for least cost. 0 for none.NoCurrent value.
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.
404The route does not exist.

Data returned

No data is returned.

Example: Changing the called prefix

http://enswitch.example.com/api/json/routes/update/?auth_username=user;auth_password=password;id=123;called_prefix=012

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

Change history

VersionChanges
3.13Function added.