Add get=username option to getmanaged API call. Business/AccountHub/commit/2e63b5dbc70417b9fc7817bbdd4a2f85dafd5b3f

This commit is contained in:
Skylar Ittner 2017-10-10 12:50:28 -06:00
parent 509bb63575
commit 6830728623

View File

@ -29,9 +29,9 @@ If the request is not well-formed (missing required arguments, invalid API key,
| `acctstatus` | `username` | Returns the account status in field `account` for the given username. Statuses are `NORMAL`, `LOCKED_OR_DISABLED`, `CHANGE_PASSWORD` (if password expired), `TERMINATED`, or `ALERT_ON_ACCESS` (like `NORMAL` except an alert email is sent to the system admin on successful login).
| `login` | `username`, `password` | Simulates a system login, processing the account status, sending login alerts if needed, and noting a successful login in the security log. Returns a `status` of `OK` if it worked (with `"alert": true` if an admin alert was sent), or a `status` of `ERROR` if anything prevented a successful login.
| `ismanagerof` | `manager`, `employee`, `uid` (optional) | Returns a boolean `managerof` which is true if `manager` is a manager of `employee` or false otherwise. If argument `uid` is present and equal to `1`, `manager` and `employee` will be treated as UIDs, else as usernames.
| `getmanaged` | `uid` or `username` | Returns an array of UIDs in `employees` corresponding to the users the given account is a manager of.
| `getmanaged` | `uid` or `username`, `get` (optional) | Returns an array of UIDs (or usernames if `get=username`) in `employees` corresponding to the users the given account is a manager of.
| `getmanagers` | `uid` or `username` | Returns an array of UIDs in `managers` corresponding to the users the given account is managed by.
| `usersearch` | `search` | Searches for users with names or usernames containing the `search`. Returns them in `result` as an indexed array. <br>Response format:<br> <code>"result":[<br> {<br> "uid":"123",<br> "username":"jdoe",<br> "name":"John Doe"<br> },<br> {<br> "uid":"124",<br> "username":"jadoe",<br> "name":"Jane Doe"<br> }<br>]</code> <br>If `search` is less than three characters long, a search will not be attempted and `result` will be an empty array (`[]`). The `result` is also `[]` if no results are found.
| `usersearch` | `search` | Searches for users with names or usernames containing the `search`. Returns them in `result` as an array. <br>Response format:<br> <code>"result":[<br> {<br> "uid":"123",<br> "username":"jdoe",<br> "name":"John Doe"<br> },<br> {<br> "uid":"124",<br> "username":"jadoe",<br> "name":"Jane Doe"<br> }<br>]</code> <br>If `search` is less than three characters long, a search will not be attempted and `result` will be an empty array (`[]`). The `result` is also `[]` if no results are found.
| `permission` | `uid` or `username`, `code` | Returns boolean `has_permission` if the given user has the given permission code. A list of valid permission codes are found in the database table `permissions`. Note: if a user has the `ADMIN` permission, this will always return true no matter what code is requested, because the user in question should have enough system access to give themselves the permission if so desired.
|`mobileenabled`| None | Returns a boolean `mobile` to indicate the value of the config setting `MOBILE_ENABLED`.
| `mobilevalid` | `username`, `code` | Returns a boolean `valid` to indicate if the supplied username and mobile code are valid.