167 lines
2.1 KiB
Markdown
167 lines
2.1 KiB
Markdown
## GET /api/v1/community/{id}
|
|
|
|
Returns a community with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"ownerId": "string",
|
|
"creationDate": "number"
|
|
}
|
|
```
|
|
|
|
## POST /api/v1/community
|
|
|
|
_Requires an authorization header_
|
|
|
|
### Request:
|
|
|
|
```json
|
|
{
|
|
"name": "string",
|
|
"description": "string?"
|
|
}
|
|
```
|
|
|
|
Creates a new community and returns it
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string",
|
|
"ownerId": "string"
|
|
}
|
|
```
|
|
|
|
## PATCH /api/v1/community/{id}
|
|
|
|
_Requires an authorization header_
|
|
|
|
### Request:
|
|
|
|
```json
|
|
{
|
|
"name": "string?",
|
|
"description": "string?"
|
|
}
|
|
```
|
|
|
|
Updates a community with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"description": "string"
|
|
}
|
|
```
|
|
|
|
## DELETE /api/v1/community/{id}
|
|
|
|
_Requires an authorization header_
|
|
|
|
Removes a community with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string"
|
|
}
|
|
```
|
|
|
|
## GET /api/v1/community/{id}/members
|
|
|
|
_Requires an authorization header_
|
|
|
|
Returns users for a community with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"members": [
|
|
{
|
|
"id": "string",
|
|
"username": "string"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## GET /api/v1/community/{id}/channels
|
|
|
|
_Requires an authorization header_
|
|
|
|
Returns channels for a community with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"channels": [
|
|
{
|
|
"id": "string",
|
|
"name": "string"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## GET /api/v1/community/{id}/roles
|
|
|
|
_Requires an authorization header_
|
|
|
|
Returns roles for a community with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"roles": [
|
|
{
|
|
"id": "string",
|
|
"name": "string"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## POST /api/v1/community/{id}/invite
|
|
|
|
_Requires an authorization header_
|
|
|
|
### Request:
|
|
|
|
```json
|
|
{
|
|
"totalInvites": "number?",
|
|
"expirationDate": "number?"
|
|
}
|
|
```
|
|
|
|
Creates an invite to a community with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"inviteId": "string"
|
|
}
|
|
```
|