nexlink/docs/api/message.md
2026-01-11 07:43:01 -05:00

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",
"userId": "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",
"userId": "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",
"userId": "string",
"channelId": "string",
"creationDate": "number"
}
```
## DELETE /api/v1/message/{id}
_Requires an authorization header_
Removes a message with id = {id}
### Response:
```json
{
"id": "string",
"userId": "string",
"channelId": "string"
}
```