JSON API » routes » routes/update
Updates an existing route.
Input parameters
Requires authentication and the system role privilege.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| id | Integer | ID of route to update. | Yes | |
| allow_plan_peers | Integer | 1 to allow rate plans to override this route, 0 not to. | No | Current value. |
| called_max | Integer | Maximum length of called number to match. | No | Current value. |
| called_min | Integer | Minimum length of called number to match. | No | Current value. |
| called_prefix | String | Called prefix to match. | No | Current value. |
| caller_prefix | String | Callerid prefix to match. Empty string for any. | No | Current value. |
| copy_costs_peer | Integer | If 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. | No | 0 |
| description | String | Description. | No | Current value. |
| media | String | Media type to match. "voice_fax" for voice or fax, "voice", "fax", or "message". | No | Current value. |
| outgroup | Integer | ID of outbound group. | No | Current value. |
| peer1 | Integer | ID of first peer to try. -1 for least cost. | No | Current value. |
| peer2 | Integer | ID of second peer to try. -1 for least cost. 0 for none. | No | Current value. |
| peer3 | Integer | ID of third peer to try. -1 for least cost. 0 for none. | No | Current value. |
| 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. |
| 404 | The 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
| Version | Changes |
|---|---|
| 3.13 | Function added. |
