Update API docs

master
Skylar Ittner 6 years ago
parent b603bd5819
commit 9a20a8e55d

@ -22,7 +22,7 @@ If the request is not well-formed (missing required arguments, invalid API key,
| ------------- | --------------------------------------- | -----------
| `ping` | None | Used to check if the server is online and responding. Responds with `{"status":"OK"}`.
| `auth` | `username`, `password` | Returns a status of `OK` if the user/pass combination are valid and allowed to login, otherwise returns `ERROR`. Also includes a `msg` with an error or success message.
| `userinfo` | `username` or `uid` | If the username or UID exist in the system, returns the user's profile data in the `data` field. <br>Response format:<br> <code>"data":{<br> "uid": "123",<br> "username": "jdoe",<br> "name": "John Doe",<br> "email": "jdoe@example.com",<br> "phone":{<br> 1: "1234567890",<br> 2: ""<br> }<br>}</code>
| `userinfo` | `username` or `uid` | If the username or UID exist in the system, returns the user's profile data in the `data` field. <br>Response format:<br> <code>"data":{<br> "uid": "123",<br> "username": "jdoe",<br> "name": "John Doe",<br> "email": "jdoe@example.com",<br> "phone": {<br> 1: "1234567890",<br> 2: ""<br> },<br> "pin": false/true<br>}</code>
| `userexists` | `username` | Returns a field `exists` which is true if the username exists or false if it does not. <br>Example response: `{"status":"OK", "exists":true}`
| `hastotp` | `username` | Returns a field `otp` which is true if the user has 2-factor authentication setup or false if the user does not.
| `verifytotp` | `username`, `code` | Checks if the given TOTP code is valid for the given user at the current time. Returns with `{"status":"OK","valid":true}` or `{"status":"ERROR","msg":"<error message>","valid":false}`.
@ -38,7 +38,8 @@ If the request is not well-formed (missing required arguments, invalid API key,
| `alertemail` | `username`, `appname` (optional) | Send alert email to system administrator regarding the specified user and application.
| `codelogin` | `code` | Validate one-time code and (if successful) return username, realname, and uid for the user who generated the code. For code generation API, see `/mobile/index.php`
| `listapps` | None | Get the list of configured apps from `settings.php` in `{"apps":{}}`.
| `getusersbygroup` | `gid`, `get` (optional) | Get all the user IDs in the specified group. If `get` equals `username`, return usernames instead of user IDs.
| `getusersbygroup` | `gid`, `get` (optional) | Get all the user IDs in the specified group. If `get` equals `username`, return usernames instead of user IDs. If `get` equals `detail`, return `[{username: x, name: y, uid: z, pin: true}]`, where `pin` is true if the user has a PIN set, otherwise false.
| `getgroupsbyuser` | `uid` or `username` | Get a list of groups as `[{"id", "name"}]` the given user (by ID or username) is a member of.
| `getgroups` | None | Get a list of all user groups in the database.
| `groupsearch` | `search` | Searches for groups with names containing the `search`. See `usersearch` for result format and more details. The differences are the fields returned (`id` and `name`) and the minimum query length (2 characters).
| `groupsearch` | `search` | Searches for groups with names containing the `search`. See `usersearch` for result format and more details. The differences are the fields returned (`id` and `name`) and the minimum query length (2 characters).
| `checkpin` | `pin`, `username` or `uid` | Check if the supplied PIN matches the user's PIN. Returns a boolean `pinvalid`. If no PIN is set, returns a `status ERROR`, `pinvalid false`, and `nopinset true`.
Loading…
Cancel
Save