55 lines
654 B
Markdown
55 lines
654 B
Markdown
## 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"
|
|
}
|
|
```
|