nexlink/docs/api/message.md
2026-01-13 17:32:06 -05:00

96 lines
1.3 KiB
Markdown

## GET /api/v1/message/{id}
_Requires an authorization header_
Returns a message with id = {id}
### Response:
```json
{
"id": "string",
"text": "string",
"iv": "string",
"editHistory": "string[]",
"edited": "boolean",
"ownerId": "string",
"channelId": "string",
"creationDate": "number"
}
```
## POST /api/v1/message
_Requires an authorization header_
### Request:
```json
{
"text": "string",
"iv": "string",
"channelId": "string"
}
```
Creates a new message and returns it
### Response:
```json
{
"id": "string",
"text": "string",
"iv": "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",
"iv": "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"
}
```