Add message api
This commit is contained in:
parent
f72d0bedb8
commit
2060bcbcbf
3 changed files with 117 additions and 1 deletions
92
docs/api/message.md
Normal file
92
docs/api/message.md
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
## 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
|
||||
{
|
||||
"newText": "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"
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue