92 lines
1.2 KiB
Markdown
92 lines
1.2 KiB
Markdown
## GET /api/v1/message/{id}
|
|
|
|
_Requires an authorization header_
|
|
|
|
Returns a message with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"text": "string",
|
|
"editHistory": "string[]",
|
|
"edited": "boolean",
|
|
"ownerId": "string",
|
|
"channelId": "string",
|
|
"creationDate": "number"
|
|
}
|
|
```
|
|
|
|
## POST /api/v1/message
|
|
|
|
_Requires an authorization header_
|
|
|
|
### Request:
|
|
|
|
```json
|
|
{
|
|
"text": "string",
|
|
"channelId": "string"
|
|
}
|
|
```
|
|
|
|
Creates a new message and returns it
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"text": "string",
|
|
"editHistory": "string[]",
|
|
"edited": "boolean",
|
|
"ownerId": "string",
|
|
"channelId": "string",
|
|
"creationDate": "number"
|
|
}
|
|
```
|
|
|
|
## PATCH /api/v1/message/{id}
|
|
|
|
_Requires an authorization header_
|
|
|
|
### Request:
|
|
|
|
```json
|
|
{
|
|
"text": "string"
|
|
}
|
|
```
|
|
|
|
Updates a message with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"text": "string",
|
|
"editHistory": "string[]",
|
|
"edited": "boolean",
|
|
"ownerId": "string",
|
|
"channelId": "string",
|
|
"creationDate": "number"
|
|
}
|
|
```
|
|
|
|
## DELETE /api/v1/message/{id}
|
|
|
|
_Requires an authorization header_
|
|
|
|
Removes a message with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"ownerId": "string",
|
|
"channelId": "string"
|
|
}
|
|
```
|