User Slack Messages API
General notes
Content
Roles collection:
Single role:
User Slack Messages collection
User slack messages index
This method needs permission
accessonuser-slack-message.
Request
| Index behaviour | Definition |
|---|---|
| Paginated by default | No |
| Sorting | id, user_id, chat_id, is_allowed |
| Filters | user_id:int, chat_id:string, is_allowed:bool |
| Embedded | - |
GET /api/v0/user-slack-messages HTTP/1.1
Content-Type: application/json
Response
200 OK
GET /api/v0/user-slack-messages HTTP/1.1
Content-Type: application/json
{
"items": [
{
"id": 1,
"user_id": 1,
"chat_id": null,
"is_allowed": true
},
{
"id": 2,
"user_id": 2,
"chat_id": null,
"is_allowed": true
},
]
}
Create user slack message
This method needs permission
createonuser-slack-message.
Request
| Param | Type | Description | Requirements |
|---|---|---|---|
user_id | int | User's id | Required. |
chat_id | int | User's slack chat id | Nullable. |
is_allowed | boolean | Allow/block Slack messages. | Default value is true. |
POST /api/v0/user-slack-messages HTTP/1.1
Content-Type: application/json
{
"user_id": 1,
"chat_id": "SD4SQ87ASX",
"is_allowed": true
},
Response
200 OK
POST /api/v0/user-slack-messages HTTP/1.1
Content-Type: application/json
{
"id": 1,
"user_id": 1,
"chat_id": null,
"is_allowed": true
}
422 UNPROCESSABLE ENTITY
Validation error occured.
Single User Slack Message
User Slack Message Detail
GET /api/v0/user-slack-messages/{id}
This method needs permission
readonuser-slack-message.
Get User slack message detail.
Request
GET /api/v0/user-slack-messages/1 HTTP/1.1
Content-Type: application/json
Response
200 OK
GET /api/v0/clients/1 HTTP/1.1
Content-Type: application/json
{
"id": 1,
"user_id": 1,
"chat_id": null,
"is_allowed": true
}
404 NOT FOUND
User slack message was not found.
Update User Slack message
PUT/PATCH /api/v0/user-slack-messages/{id}
This method needs permission
updateonuser-slack-message.
Request
| Param | Type | Description | Requirements |
|---|---|---|---|
user_id | int | User's id | Sometimes. Has to be int. |
chat_id | string | Chat id | Sometimes. Nullable. Has to be string. Usually is set automatically. |
is_allowed | bool | Allow/block messages | Sometimes. Has to be bool. |
For PATCH method any field can be omitted.
PATCH /api/v0/user-slack-messages/1 HTTP/1.1
Content-Type: application/json
{
"is_allowed": false,
}
Response
200 OK
404 NOT FOUND
422 UNPROCESSABLE ENTITY
Validation error occurred.
Delete User Slack Message
DELETE /api/v0/user-slack-messages/{id}
This method needs permission
deleteonuser-slack-message.
Delete User slack message detail.
Request
DELETE /api/v0/user-slack-messages/1 HTTP/1.1
Content-Type: application/json