JSON API » classes » classes/list
Gets the fields of all number classes visible to the user.
Input parameters
Authentication is optional.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | No | None. |
auth_password | String | Authentication password. | No | None. |
callerid_location | Integer | 1 to only return classes that can be used as location callerid, 0 not to. Has no effect unless location callerid is enabled. | No | 0 |
customer | Integer | ID of customer to get. | No | Customer 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
Code | Description |
---|---|
200 | Success. |
400 | Invalid 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
Version | Changes |
---|---|
3.13 | Function added. |