Настройки уведомлений API 1.7.0
Методы API для работы с разделом «Настройки уведомлений».
Базовый путь: https://{IP_контроллера}/api/v1.
Версия описания API: 1.7.0.
Примеры используют placeholder-значения для паролей, token, UUID, адресов и секретов. Перед выполнением запроса замените их на значения вашего контроллера.
Методы раздела
| Метод | Путь |
|---|---|
GET | /notification_settings |
POST | /notification_settings |
GET | /notification_settings/events_types |
GET | /notification_settings/{id} |
PUT | /notification_settings/{id} |
DELETE | /notification_settings/{id} |
GET /notification_settings
Раздел: Настройки уведомлений.
Возвращает список настроек уведомлений.
Параметры и ответы по OpenAPI
{
"description": "Returns list of Notification Settings",
"responses": {
"200": {
"description": "Successfully returned all installed Notification Settings",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"name",
"source_event_type",
"source_events"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string"
},
"message_text": {
"type": "string"
},
"channel": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"description": "Channel link uuid"
},
"source_event_type": {
"type": "string",
"enum": [
"access",
"alert",
"notification"
],
"description": "Source filter by event type"
},
"source_events": {
"type": "array",
"description": "Source filter by event",
"items": {
"additionalProperties": true,
"properties": {
"segr": {
"type": "string",
"description": "Event code or event type"
},
"val": {
"type": "string",
"description": "Event reason"
},
"title": {
"type": "string"
}
}
}
},
"source_access_points": {
"description": "Source filter by event",
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "Access point uuid"
}
}
}
},
"source_zones": {
"type": "array",
"description": "Source filter by zones",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "Zone name"
}
}
}
},
"source_user_type": {
"type": "string",
"description": "Source filter by user type",
"enum": [
"staff",
"visitor",
""
]
},
"source_filters": {
"type": "array",
"description": "Source filters by dictionary",
"items": {
"type": "object",
"properties": {
"key": {
"description": "Filter name",
"type": "string"
},
"value": {
"description": "Filter value",
"type": "string"
}
}
}
},
"source_full_names": {
"description": "Source filter by full names",
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "User uuid"
}
}
}
},
"recipient_filter_type": {
"type": "string",
"description": "Recipient filter type",
"enum": [
"TELEGRAM",
"DICTIONARY",
"TELEGRAM_USERS"
]
},
"recipient_users_list": {
"type": "array",
"description": "Recipient user`s usernames list",
"items": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_]{4,31}$"
}
},
"dict_address": {
"type": "string",
"description": "Recipient address to send messages"
},
"recipient_user_type": {
"type": "string",
"description": "Recipient filter by user type",
"enum": [
"staff",
"visitor"
]
},
"recipient_full_names": {
"description": "Recipient filter by full names",
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "User uuid"
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/notification_settings" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"uuid": "string",
"name": "string",
"message_text": "string",
"channel": "string",
"source_event_type": "access",
"source_events": [
{
"segr": "string",
"val": "string",
"title": "string"
}
],
"source_access_points": [
{
"title": "string",
"val": "string"
}
],
"source_zones": [
{
"title": "string",
"val": "string"
}
],
"source_user_type": "staff",
"source_filters": [
{
"key": "string",
"value": "string"
}
],
"source_full_names": [
{
"title": "string",
"val": "string"
}
],
"recipient_filter_type": "TELEGRAM",
"recipient_users_list": [
"string"
],
"dict_address": "string",
"recipient_user_type": "staff",
"recipient_full_names": [
{
"title": "string",
"val": "string"
}
]
}
]
POST /notification_settings
Раздел: Настройки уведомлений.
Создает настройки уведомлений.
Параметры и ответы по OpenAPI
{
"description": "Create new notification settings",
"requestBody": {
"description": "JSON containing notification settings",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"name",
"source_event_type",
"source_events"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string"
},
"message_text": {
"type": "string"
},
"channel": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"description": "Channel link uuid"
},
"source_event_type": {
"type": "string",
"enum": [
"access",
"alert",
"notification"
],
"description": "Source filter by event type"
},
"source_events": {
"type": "array",
"description": "Source filter by event",
"items": {
"additionalProperties": true,
"properties": {
"segr": {
"type": "string",
"description": "Event code or event type"
},
"val": {
"type": "string",
"description": "Event reason"
},
"title": {
"type": "string"
}
}
}
},
"source_access_points": {
"description": "Source filter by event",
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "Access point uuid"
}
}
}
},
"source_zones": {
"type": "array",
"description": "Source filter by zones",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "Zone name"
}
}
}
},
"source_user_type": {
"type": "string",
"description": "Source filter by user type",
"enum": [
"staff",
"visitor",
""
]
},
"source_filters": {
"type": "array",
"description": "Source filters by dictionary",
"items": {
"type": "object",
"properties": {
"key": {
"description": "Filter name",
"type": "string"
},
"value": {
"description": "Filter value",
"type": "string"
}
}
}
},
"source_full_names": {
"description": "Source filter by full names",
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "User uuid"
}
}
}
},
"recipient_filter_type": {
"type": "string",
"description": "Recipient filter type",
"enum": [
"TELEGRAM",
"DICTIONARY",
"TELEGRAM_USERS"
]
},
"recipient_users_list": {
"type": "array",
"description": "Recipient user`s usernames list",
"items": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_]{4,31}$"
}
},
"dict_address": {
"type": "string",
"description": "Recipient address to send messages"
},
"recipient_user_type": {
"type": "string",
"description": "Recipient filter by user type",
"enum": [
"staff",
"visitor"
]
},
"recipient_full_names": {
"description": "Recipient filter by full names",
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "User uuid"
}
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful operation"
},
"400": {
"description": "Invalid JSON file"
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X POST "https://{IP_контроллера}/api/v1/notification_settings" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"name": "string",
"message_text": "string",
"channel": "string",
"source_event_type": "access",
"source_events": [
{
"segr": "string",
"val": "string",
"title": "string"
}
],
"source_access_points": [
{
"title": "string",
"val": "string"
}
],
"source_zones": [
{
"title": "string",
"val": "string"
}
],
"source_user_type": "staff",
"source_filters": [
{
"key": "string",
"value": "string"
}
],
"source_full_names": [
{
"title": "string",
"val": "string"
}
],
"recipient_filter_type": "TELEGRAM",
"recipient_users_list": [
"string"
],
"dict_address": "string",
"recipient_user_type": "staff",
"recipient_full_names": [
{
"title": "string",
"val": "string"
}
]
}'
Пример тела запроса
{
"uuid": "string",
"name": "string",
"message_text": "string",
"channel": "string",
"source_event_type": "access",
"source_events": [
{
"segr": "string",
"val": "string",
"title": "string"
}
],
"source_access_points": [
{
"title": "string",
"val": "string"
}
],
"source_zones": [
{
"title": "string",
"val": "string"
}
],
"source_user_type": "staff",
"source_filters": [
{
"key": "string",
"value": "string"
}
],
"source_full_names": [
{
"title": "string",
"val": "string"
}
],
"recipient_filter_type": "TELEGRAM",
"recipient_users_list": [
"string"
],
"dict_address": "string",
"recipient_user_type": "staff",
"recipient_full_names": [
{
"title": "string",
"val": "string"
}
]
}
GET /notification_settings/events_types
Раздел: Настройки уведомлений.
Возвращает список доступных типов событий.
Параметры и ответы по OpenAPI
{
"description": "Get available events types list",
"responses": {
"200": {
"description": "Successfully got events types",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"notification",
"alert",
"access"
],
"properties": {
"notification": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"source_type",
"description"
],
"properties": {
"code": {
"type": "integer",
"description": "Event type"
},
"source_type": {
"type": "string",
"description": "Event reason"
},
"description": {
"type": "string",
"description": "Event short description"
}
}
}
},
"alert": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"source_type",
"description"
],
"properties": {
"code": {
"type": "integer",
"description": "Event type"
},
"source_type": {
"type": "string",
"description": "Event reason"
},
"description": {
"type": "string",
"description": "Event short description"
}
}
}
},
"access": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"reason",
"description"
],
"properties": {
"type": {
"type": "string",
"description": "Event type"
},
"reason": {
"type": "string",
"description": "Event reason"
},
"description": {
"type": "string",
"description": "Event short description"
}
}
}
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/notification_settings/events_types" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"notification": [
{
"code": 1,
"source_type": "string",
"description": "string"
}
],
"alert": [
{
"code": 1,
"source_type": "string",
"description": "string"
}
],
"access": [
{
"type": "string",
"reason": "string",
"description": "string"
}
]
}
GET /notification_settings/{id}
Раздел: Настройки уведомлений.
Возвращает настройки уведомлений по идентификатору.
Параметры и ответы по OpenAPI
{
"description": "Delete Skd Module",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful operation"
},
"400": {
"description": "Bad request"
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/notification_settings/{id}" \
-H "Authorization: Bearer <token>"
PUT /notification_settings/{id}
Раздел: Настройки уведомлений.
Обновляет настройки уведомлений.
Параметры и ответы по OpenAPI
{
"description": "Update settings",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "JSON containing the new settings",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"name",
"source_event_type",
"source_events"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string"
},
"message_text": {
"type": "string"
},
"channel": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"description": "Channel link uuid"
},
"source_event_type": {
"type": "string",
"enum": [
"access",
"alert",
"notification"
],
"description": "Source filter by event type"
},
"source_events": {
"type": "array",
"description": "Source filter by event",
"items": {
"additionalProperties": true,
"properties": {
"segr": {
"type": "string",
"description": "Event code or event type"
},
"val": {
"type": "string",
"description": "Event reason"
},
"title": {
"type": "string"
}
}
}
},
"source_access_points": {
"description": "Source filter by event",
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "Access point uuid"
}
}
}
},
"source_zones": {
"type": "array",
"description": "Source filter by zones",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "Zone name"
}
}
}
},
"source_user_type": {
"type": "string",
"description": "Source filter by user type",
"enum": [
"staff",
"visitor",
""
]
},
"source_filters": {
"type": "array",
"description": "Source filters by dictionary",
"items": {
"type": "object",
"properties": {
"key": {
"description": "Filter name",
"type": "string"
},
"value": {
"description": "Filter value",
"type": "string"
}
}
}
},
"source_full_names": {
"description": "Source filter by full names",
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "User uuid"
}
}
}
},
"recipient_filter_type": {
"type": "string",
"description": "Recipient filter type",
"enum": [
"TELEGRAM",
"DICTIONARY",
"TELEGRAM_USERS"
]
},
"recipient_users_list": {
"type": "array",
"description": "Recipient user`s usernames list",
"items": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_]{4,31}$"
}
},
"dict_address": {
"type": "string",
"description": "Recipient address to send messages"
},
"recipient_user_type": {
"type": "string",
"description": "Recipient filter by user type",
"enum": [
"staff",
"visitor"
]
},
"recipient_full_names": {
"description": "Recipient filter by full names",
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"val": {
"type": "string",
"description": "User uuid"
}
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful operation"
},
"400": {
"description": "Bad request"
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X PUT "https://{IP_контроллера}/api/v1/notification_settings/{id}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"name": "string",
"message_text": "string",
"channel": "string",
"source_event_type": "access",
"source_events": [
{
"segr": "string",
"val": "string",
"title": "string"
}
],
"source_access_points": [
{
"title": "string",
"val": "string"
}
],
"source_zones": [
{
"title": "string",
"val": "string"
}
],
"source_user_type": "staff",
"source_filters": [
{
"key": "string",
"value": "string"
}
],
"source_full_names": [
{
"title": "string",
"val": "string"
}
],
"recipient_filter_type": "TELEGRAM",
"recipient_users_list": [
"string"
],
"dict_address": "string",
"recipient_user_type": "staff",
"recipient_full_names": [
{
"title": "string",
"val": "string"
}
]
}'
Пример тела запроса
{
"uuid": "string",
"name": "string",
"message_text": "string",
"channel": "string",
"source_event_type": "access",
"source_events": [
{
"segr": "string",
"val": "string",
"title": "string"
}
],
"source_access_points": [
{
"title": "string",
"val": "string"
}
],
"source_zones": [
{
"title": "string",
"val": "string"
}
],
"source_user_type": "staff",
"source_filters": [
{
"key": "string",
"value": "string"
}
],
"source_full_names": [
{
"title": "string",
"val": "string"
}
],
"recipient_filter_type": "TELEGRAM",
"recipient_users_list": [
"string"
],
"dict_address": "string",
"recipient_user_type": "staff",
"recipient_full_names": [
{
"title": "string",
"val": "string"
}
]
}
DELETE /notification_settings/{id}
Раздел: Настройки уведомлений.
Удаляет настройки уведомлений.
Параметры и ответы по OpenAPI
{
"description": "Delete settings",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful operation"
},
"400": {
"description": "Bad request"
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X DELETE "https://{IP_контроллера}/api/v1/notification_settings/{id}" \
-H "Authorization: Bearer <token>"