JSON API » codes » codes/list

Gets the fields of all feature codes visible to the user in the given customer.

Input parameters

Requires authentication and the user role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
customerIntegerID of customer to get feature codes for.NoCustomer of authentication user.
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
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
sortStringField to sort by. "code", "destination", or "dnumber".No"code"

Responses

CodeDescription
200Success.
400Invalid customer specified.
401The authentication details provided are invalid.
402Your role does not allow this.

Data returned

An array of fields, corresponding to the rows of the numbers table in the database.

Example: With required parameters

http://enswitch.example.com/api/json/codes/list/?auth_username=user;auth_password=password

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "code":"100", "description":"example1", ... }, { "code":"101", "description":"example2", ... } ] }

Change history

VersionChanges
3.13Function added.