JSON API » people » people/get
Gets the fields of a person.
Input parameters
Requires authentication and the user role privilege, unless check=1.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes, unless check=1. | None. |
| auth_password | String | Authentication password. | Yes, unless check=1. | None. |
| check | Integer | 1 to just check if the person exists, 0 to return full data. | No | 0 |
| String | Email address of person to get. | No | Empty string. | |
| id | Integer | ID of person to get. | No | 0 |
| username | String | User name of person to get. | No |
One of email, id, or username must be specified. If the system is not configured to require unique email addresses, use of the email parameter is not recommended.
Responses
| Code | Description |
|---|---|
| 200 | Success. |
| 400 | One of email, id, or username must be specified. |
| 401 | The authentication details provided are invalid. |
| 402 | Your role does not allow this. |
| 404 | The person does not exist, or you do not have permission to view them. |
| 409 | Multiple persons exist with the same email. |
Data returned
Fields of person.
Example: With ID
http://enswitch.example.com/api/json/people/get/?auth_username=user;auth_password=password;id=123{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123, "username":"user@example.com", ... } }
Change history
| Version | Changes |
|---|---|
| 3.14 | Search criteria order changed: first the id is searched for, then the username and lastly the email. If more than one users are found an error 409 is returned. |
| 3.13 | Function added. |
