docs/api: change whitespace formatting

This commit is contained in:
rr- 2016-04-13 13:33:03 +02:00
parent 4df05fe3ec
commit 3384653871

18
API.md
View file

@ -78,6 +78,7 @@ data.
### Listing users ### Listing users
Request: `GET /users/?page=<page>&pageSize=<page-size>&query=<query>` Request: `GET /users/?page=<page>&pageSize=<page-size>&query=<query>`
Output: Output:
```json5 ```json5
{ {
@ -96,6 +97,7 @@ Output:
``` ```
...where `<user>` is an [user resource](#user) and `query` contains standard ...where `<user>` is an [user resource](#user) and `query` contains standard
[search query](#search). [search query](#search).
Errors: if privileges are too low. Errors: if privileges are too low.
Searches for users. Searches for users.
@ -129,6 +131,7 @@ Available search orders:
### Creating user ### Creating user
Request: `POST /users` Request: `POST /users`
Input: Input:
```json5 ```json5
{ {
@ -137,6 +140,7 @@ Input:
"email": <email> "email": <email>
} }
``` ```
Output: Output:
```json5 ```json5
{ {
@ -144,6 +148,7 @@ Output:
} }
``` ```
...where `<user>` is an [user resource](#user). ...where `<user>` is an [user resource](#user).
Errors: if such user already exists (names are case insensitive), or either of Errors: if such user already exists (names are case insensitive), or either of
user name, password and email are invalid, or privileges are too low. user name, password and email are invalid, or privileges are too low.
@ -157,6 +162,7 @@ administrator. Subsequent users will be given the rank indicated by
### Updating user ### Updating user
Request: `PUT /user/<name>` Request: `PUT /user/<name>`
Input: Input:
```json5 ```json5
{ {
@ -167,7 +173,9 @@ Input:
"avatarStyle": <avatar-style> "avatarStyle": <avatar-style>
} }
``` ```
Files: `avatar` - the content of the new avatar. Files: `avatar` - the content of the new avatar.
Output: Output:
```json5 ```json5
{ {
@ -175,6 +183,7 @@ Output:
} }
``` ```
...where `<user>` is an [user resource](#user). ...where `<user>` is an [user resource](#user).
Errors: if the user does not exist, or the user with new name already exists Errors: if the user does not exist, or the user with new name already exists
(names are case insensitive), or either of user name, password, email or rank (names are case insensitive), or either of user name, password, email or rank
are invalid, or the user is trying to update their or someone else's rank to are invalid, or the user is trying to update their or someone else's rank to
@ -191,6 +200,7 @@ pass also `avatar` file - see [file uploads](#file-uploads) for details.
### Getting user ### Getting user
Request: `GET /user/<name>` Request: `GET /user/<name>`
Output: Output:
```json5 ```json5
{ {
@ -198,6 +208,7 @@ Output:
} }
``` ```
...where `<user>` is an [user resource](#user). ...where `<user>` is an [user resource](#user).
Errors: if the user does not exist or privileges are too low. Errors: if the user does not exist or privileges are too low.
Retrieves information about an existing user. Retrieves information about an existing user.
@ -205,10 +216,12 @@ Retrieves information about an existing user.
### Removing user ### Removing user
Request: `DELETE /user/<name>` Request: `DELETE /user/<name>`
Output: Output:
```json5 ```json5
{} {}
``` ```
Errors: if the user does not exist or privileges are too low. Errors: if the user does not exist or privileges are too low.
Deletes existing user. Deletes existing user.
@ -216,10 +229,12 @@ Deletes existing user.
### Password reset - step 1: mail request ### Password reset - step 1: mail request
Request: `GET /password-reset/<email-or-name>` Request: `GET /password-reset/<email-or-name>`
Output: Output:
``` ```
{} {}
```` ````
Errors: if the user does not exist, or they haven't provided an email address. Errors: if the user does not exist, or they haven't provided an email address.
Sends a confirmation email to given user. The email contains link containing a Sends a confirmation email to given user. The email contains link containing a
@ -230,18 +245,21 @@ indication they are the rightful owner of the account.
### Password reset - step 2: confirmation ### Password reset - step 2: confirmation
Request: `POST /password-reset/<email-or-name>` Request: `POST /password-reset/<email-or-name>`
Input: Input:
```json5 ```json5
{ {
"token": <token-from-email> "token": <token-from-email>
} }
``` ```
Output: Output:
```json5 ```json5
{ {
"password": <new-password> "password": <new-password>
} }
``` ```
Errors: if the token is missing, the token is invalid or the user does not Errors: if the token is missing, the token is invalid or the user does not
exist. exist.