JSON API » people » people/list
Gets the fields of all people in a given customer.
Input parameters
Requires authentication and the user role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
count | Integer | 1 to return a count, 0 to return full data. | No | 0 |
customer | Integer | ID of customer to get people for. | No | Customer of authentication user. |
descending | Integer | 1 to sort descending, 0 not to. | No | 0 |
limit | Integer | The maximum results to return. 0 for all. | No | 0 |
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. "forename", "fullname", "surname", or "username". | No | "username" |
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. |
Data returned
An array of fields, corresponding to the rows of the people table in the database. Passwords are not included.
Example: With required parameters
http://enswitch.example.com/api/json/people/list/?auth_username=user;auth_password=password{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "username":"user1@example.com", ... }, { "id":2, "username":"user2@example.com", ... }, ] }
Change history
Version | Changes |
---|---|
3.13 | Function added. |