Formatting; Creation dates
This commit is contained in:
parent
d1685fde77
commit
a85fc8a49d
7 changed files with 94 additions and 41 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
## POST /api/v1/auth/register
|
## POST /api/v1/auth/register
|
||||||
|
|
||||||
### Request:
|
### Request:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"username": "string",
|
"username": "string",
|
||||||
|
|
@ -11,6 +13,7 @@
|
||||||
Registers a new user
|
Registers a new user
|
||||||
|
|
||||||
### Response (success):
|
### Response (success):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
|
|
@ -20,6 +23,7 @@ Registers a new user
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response (error):
|
### Response (error):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"error": "user already exists"
|
"error": "user already exists"
|
||||||
|
|
@ -29,7 +33,9 @@ Registers a new user
|
||||||
---
|
---
|
||||||
|
|
||||||
## POST /api/v1/auth/login
|
## POST /api/v1/auth/login
|
||||||
|
|
||||||
### Request:
|
### Request:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"username": "string",
|
"username": "string",
|
||||||
|
|
@ -40,6 +46,7 @@ Registers a new user
|
||||||
Logs in a user and returns a new session
|
Logs in a user and returns a new session
|
||||||
|
|
||||||
### Response (success):
|
### Response (success):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
|
|
@ -49,6 +56,7 @@ Logs in a user and returns a new session
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response (incorrect credentials):
|
### Response (incorrect credentials):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"ownerId": "string",
|
"ownerId": "string",
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
## GET /api/v1/channel/{id}
|
## GET /api/v1/channel/{id}
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Returns a channel with id = {id}
|
Returns a channel with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"name": "string",
|
"name": "string",
|
||||||
"communityId": "string"
|
"communityId": "string",
|
||||||
|
"creationDate": 0
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,26 @@
|
||||||
## GET /api/v1/community/{id}
|
## GET /api/v1/community/{id}
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Returns a community with id = {id}
|
Returns a community with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"name": "string",
|
"name": "string",
|
||||||
"description": "string"
|
"description": "string",
|
||||||
|
"creationDate": 0
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## UPDATE /api/v1/community/{id}/name
|
## UPDATE /api/v1/community/{id}/name
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
### Request:
|
### Request:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"name": "string"
|
"name": "string"
|
||||||
|
|
@ -25,17 +30,20 @@ Returns a community with id = {id}
|
||||||
Updates name for a community with id = {id}
|
Updates name for a community with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"name": "string",
|
"name": "string"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## PATCH /api/v1/community/{id}/description
|
## PATCH /api/v1/community/{id}/description
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
### Request:
|
### Request:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"description": "string"
|
"description": "string"
|
||||||
|
|
@ -45,19 +53,22 @@ Updates name for a community with id = {id}
|
||||||
Updates description for a community with id = {id}
|
Updates description for a community with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"description": "string",
|
"description": "string"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## GET /api/v1/community/{id}/members
|
## GET /api/v1/community/{id}/members
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Returns users for a community with id = {id}
|
Returns users for a community with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
|
|
@ -72,11 +83,13 @@ Returns users for a community with id = {id}
|
||||||
```
|
```
|
||||||
|
|
||||||
## GET /api/v1/community/{id}/channels
|
## GET /api/v1/community/{id}/channels
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Returns channels for a community with id = {id}
|
Returns channels for a community with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
|
|
@ -91,11 +104,13 @@ Returns channels for a community with id = {id}
|
||||||
```
|
```
|
||||||
|
|
||||||
## GET /api/v1/community/{id}/roles
|
## GET /api/v1/community/{id}/roles
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Returns roles for a community with id = {id}
|
Returns roles for a community with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
|
|
@ -110,9 +125,11 @@ Returns roles for a community with id = {id}
|
||||||
```
|
```
|
||||||
|
|
||||||
## POST /api/v1/community/{id}/invite
|
## POST /api/v1/community/{id}/invite
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
### Request:
|
### Request:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"userId": "string"
|
"userId": "string"
|
||||||
|
|
@ -122,20 +139,22 @@ Returns roles for a community with id = {id}
|
||||||
Creates an invite to a community with id = {id}
|
Creates an invite to a community with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"userId": "string",
|
"userId": "string",
|
||||||
"userName": "string",
|
"userName": "string",
|
||||||
"communityId": "string",
|
"communityId": "string",
|
||||||
"communityName": "string",
|
"communityName": "string"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## POST /api/v1/community/{id}/join
|
## POST /api/v1/community/{id}/join
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
### Request:
|
### Request:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"userId": "string"
|
"userId": "string"
|
||||||
|
|
@ -145,11 +164,12 @@ Creates an invite to a community with id = {id}
|
||||||
Joins a user to a community with id = {id}
|
Joins a user to a community with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"userId": "string",
|
"userId": "string",
|
||||||
"userName": "string",
|
"userName": "string",
|
||||||
"communityId": "string",
|
"communityId": "string",
|
||||||
"communityName": "string",
|
"communityName": "string"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
## GET /api/v1/invite/{id}
|
## GET /api/v1/invite/{id}
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Returns an invite with id = {id}
|
Returns an invite with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
|
|
@ -18,14 +20,16 @@ Returns an invite with id = {id}
|
||||||
```
|
```
|
||||||
|
|
||||||
## DELETE /api/v1/invite/{id}
|
## DELETE /api/v1/invite/{id}
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Removes an invite with id = {id}
|
Removes an invite with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"communityId": "string",
|
"communityId": "string"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
## GET /api/v1/role/{id}
|
## GET /api/v1/role/{id}
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Returns a role with id = {id}
|
Returns a role with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"name": "string",
|
"name": "string",
|
||||||
"communityId": "string"
|
"communityId": "string",
|
||||||
|
"creationDate": 0
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,30 @@
|
||||||
## GET /api/v1/session/{id}
|
## GET /api/v1/session/{id}
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Returns a session with id = {id}
|
Returns a session with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": "string",
|
||||||
|
"userId": "string",
|
||||||
|
"creationDate": 0
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## DELETE /api/v1/session/{id}
|
||||||
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
|
Revokes a session with id = {id}
|
||||||
|
|
||||||
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"userId": "string"
|
"userId": "string"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## DELETE /api/v1/session/{id}
|
|
||||||
*Requires an authentication header*
|
|
||||||
|
|
||||||
Revokes a session with id = {id}
|
|
||||||
|
|
||||||
### Response:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"id": "string",
|
|
||||||
"userId": "string",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
## GET /api/v1/user/{id}
|
## GET /api/v1/user/{id}
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Returns a user with id = {id}
|
Returns a user with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
|
|
@ -17,11 +19,13 @@ Returns a user with id = {id}
|
||||||
```
|
```
|
||||||
|
|
||||||
## GET /api/v1/user/{id}/sessions
|
## GET /api/v1/user/{id}/sessions
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
Returns all sessions for a user with id = {id}
|
Returns all sessions for a user with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"sessions": [
|
"sessions": [
|
||||||
|
|
@ -34,9 +38,11 @@ Returns all sessions for a user with id = {id}
|
||||||
```
|
```
|
||||||
|
|
||||||
## PATCH /api/v1/user/{id}/email
|
## PATCH /api/v1/user/{id}/email
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
### Request:
|
### Request:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"email": "string"
|
"email": "string"
|
||||||
|
|
@ -46,17 +52,20 @@ Returns all sessions for a user with id = {id}
|
||||||
Updates email for a user with id = {id}
|
Updates email for a user with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"email": "string",
|
"email": "string"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## PATCH /api/v1/user/{id}/description
|
## PATCH /api/v1/user/{id}/description
|
||||||
*Requires an authentication header*
|
|
||||||
|
_Requires an authentication header_
|
||||||
|
|
||||||
### Request:
|
### Request:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"description": "string"
|
"description": "string"
|
||||||
|
|
@ -66,9 +75,10 @@ Updates email for a user with id = {id}
|
||||||
Updates description for a user with id = {id}
|
Updates description for a user with id = {id}
|
||||||
|
|
||||||
### Response:
|
### Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "string",
|
"id": "string",
|
||||||
"description": "string",
|
"description": "string"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue