JSON API » plans » plans/routes/list
Gets the fields of routes in a given rate plan.
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 | |
| plan | Integer | ID of rate plan to get routes for. | Yes | |
| called_prefix | String | Only return routes with called prefix starting with this. Empty string for all. | No | Empty string. |
| caller_prefix | String | Only return routes with caller prefix starting with this. Empty string for all. | No | Empty string. |
| count | Integer | 1 to return a count, 0 to return full data. | No | 0 |
| descending | Integer | 1 to sort descending, 0 not to. | No | 0 |
| limit | Integer | The maximum results to return. 0 for all. | No | 0 |
| media | String | Only return routes with this media. "fax", "voice", "voice_fax", or empty string for all. | No | Empty string. |
| offset | Integer | The result to start at. 0 for the first. | No | 0 |
| pages | Integer | 1 to return a reduced set of data for generating the pages select box, 0 to return full data. | No | 0 |
| sort | String | Field to sort by. "allow", "called_prefix", "caller_prefix", or "media". | No | "called_prefix" |
Responses
| Code | Description |
|---|---|
| 200 | 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 rate plan does not exist, or you do not have permission to view it. |
Data returned
An array of fields, corresponding to the rows of the plan_routes table in the database.
Example: With required parameters
http://enswitch.example.com/api/json/plans/routes/list/?auth_username=user;auth_password=password;plan=123{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "plan":123, "called_prefix":"", ... }, { "plan":123, "called_prefix":"011", ... } ] }
Change history
| Version | Changes |
|---|---|
| 4.1 | prefix input parameter renamed to called_prefix. caller_prefix input parameter added. sort parameter values changed. |
| 3.13 | Function added. |
