nexlink/docs/api/community.md

155 lines
2.2 KiB
Markdown

## GET /api/v1/community/{id}
*Requires an authentication header*
Returns a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
"description": "string"
}
```
## UPDATE /api/v1/community/{id}/name
*Requires an authentication header*
### Request:
```json
{
"name": "string"
}
```
Updates name for a community with id = {id}
### Response:
```json
{
"id": "string",
"name": "string",
}
```
## PATCH /api/v1/community/{id}/description
*Requires an authentication header*
### Request:
```json
{
"description": "string"
}
```
Updates description for a community with id = {id}
### Response:
```json
{
"id": "string",
"description": "string",
}
```
## GET /api/v1/community/{id}/members
*Requires an authentication 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 authentication 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 authentication 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 authentication header*
### Request:
```json
{
"userId": "string"
}
```
Creates an invite to a community with id = {id}
### Response:
```json
{
"userId": "string",
"userName": "string",
"communityId": "string",
"communityName": "string",
}
```
## POST /api/v1/community/{id}/join
*Requires an authentication header*
### Request:
```json
{
"userId": "string"
}
```
Joins a user to a community with id = {id}
### Response:
```json
{
"userId": "string",
"userName": "string",
"communityId": "string",
"communityName": "string",
}
```