Add initial docs
This commit is contained in:
parent
3803d0cd09
commit
1b024e31bb
2 changed files with 70 additions and 0 deletions
55
docs/api/auth.md
Normal file
55
docs/api/auth.md
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
## POST /api/v1/register
|
||||||
|
### Body:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"username": "string",
|
||||||
|
"password": "string",
|
||||||
|
"email": "string"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Registers a new user
|
||||||
|
|
||||||
|
### Returns (success):
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"username": "string",
|
||||||
|
"registerDate": 0
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Returns (error):
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"error": "user already exists"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## POST /api/v1/login
|
||||||
|
### Body:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"username": "string",
|
||||||
|
"password": "string"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Logs in a user and returns a new session
|
||||||
|
|
||||||
|
### Returns (success):
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"owner": "string",
|
||||||
|
"token": "string"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Returns (incorrect credentials):
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"owner": "string",
|
||||||
|
"error": "incorrect credentials"
|
||||||
|
}
|
||||||
|
```
|
||||||
15
docs/api/user.md
Normal file
15
docs/api/user.md
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
## GET /api/v1/user/{id}
|
||||||
|
Returns a user object with id = {id}
|
||||||
|
|
||||||
|
### Returns:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": "string",
|
||||||
|
"username": "string",
|
||||||
|
"email": "string",
|
||||||
|
"description": "string",
|
||||||
|
"admin": false,
|
||||||
|
"registerDate": 0,
|
||||||
|
"lastLogin": 0
|
||||||
|
}
|
||||||
|
```
|
||||||
Loading…
Add table
Add a link
Reference in a new issue