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.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
planIntegerID of rate plan to get routes for.Yes
countInteger1 to return a count, 0 to return full data.No0
descendingInteger1 to sort descending, 0 not to.No0
limitIntegerThe maximum results to return. 0 for all.No0
mediaStringOnly return routes with this media. "fax", "voice", "voice_fax", or empty string for all.NoEmpty string.
offsetIntegerThe result to start at. 0 for the first.No0
pagesInteger1 to return a reduced set of data for generating the pages select box, 0 to return full data.No0
prefixStringOnly return routes with prefix starting with this. Empty string for all.NoEmpty string.
sortStringField to sort by. "allow", "media", or "prefix".No"prefix"

Responses

CodeDescription
200Success.
401The authentication details provided are invalid.
402Your role does not allow this.
404The 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, "prefix":"", ... }, { "plan":123, "prefix":"011", ... } ] }

Change history

VersionChanges
3.13Function added.