JSON API » classes » classes/list

Gets the fields of all number classes visible to the user.

Input parameters

Authentication is optional.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.NoNone.
auth_passwordStringAuthentication password.NoNone.
callerid_locationInteger1 to only return classes that can be used as location callerid, 0 not to. Has no effect unless location callerid is enabled.No0
customerIntegerID of customer to get.NoCustomer of authentication user.

If no authentication is provided, the callerid_location and customer parameters are ignored, and only number classes not owned by any customer are returned.

Responses

CodeDescription
200Success.
400Invalid customer specified.

Data returned

An array of fields, corresponding to the rows of the classes table in the database. If authentication is not supplied, only those classes that may be used in signup are returned.

Example: With authentication

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

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "name":"example1", ... }, { "id":2, "name":"example2", ... } ] }

Example: Without authentication

http://enswitch.example.com/api/json/classes/list/

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "name":"example1", ... }, { "id":2, "name":"example2", ... } ] }

Change history

VersionChanges
3.13Function added.