JSON API » plans » plans/routes/update
Updates an existing rate plan route.
Input parameters
Requires authentication and the commerce role privilege.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| id | Integer | ID of rate plan route to update. | Yes | |
| allow | Integer | Whether 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. | 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. |
| description | String | Description. | No | Current value. |
| media | String | Media type. "fax", "voice", or "voice_fax". | No | Current value. |
| peer1 | Integer | ID of first peer to route to. 0 for default, -1 for least cost. | No | Current value. |
| peer2 | Integer | ID of second peer to route to. 0 for none, -1 for least cost. | No | Current value. |
| peer3 | Integer | ID of third peer to route to. 0 for none, -1 for least cost. | No | Current value. |
| validation | Integer | 1 to validate input then return, 0 for full action. | No | Current value. |
Responses
| Code | Description |
|---|---|
| 204 | Success. |
| 201 | Input passed validation. Only returned if validation=1. |
| 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. |
| 403 | Your rate plan does not allow this. |
| 404 | The 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
| Version | Changes |
|---|---|
| 4.1 | prefix input parameter renamed to called_prefix. id and caller_prefix input parameters added. plan input parameter removed. |
| 3.13 | Function added. |
