Add message api
This commit is contained in:
parent
f72d0bedb8
commit
2060bcbcbf
3 changed files with 117 additions and 1 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
0.3.7
|
0.4.0
|
||||||
|
|
|
||||||
|
|
@ -84,3 +84,27 @@ Removes a channel with id = {id}
|
||||||
"communityId": "string"
|
"communityId": "string"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## GET /api/v1/channel/{id}/messages
|
||||||
|
|
||||||
|
_Requires an authorization header_
|
||||||
|
|
||||||
|
Returns messages for a channel with id = {id}
|
||||||
|
|
||||||
|
### Response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": "string",
|
||||||
|
"name": "string",
|
||||||
|
"messages": [
|
||||||
|
{
|
||||||
|
"id": "string",
|
||||||
|
"userId": "string",
|
||||||
|
"text": "string",
|
||||||
|
"edited": "boolean",
|
||||||
|
"creationDate": "number"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
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