Перейти к основному содержимому

Каналы уведомлений API 1.7.0

Методы API для работы с разделом «Каналы уведомлений».

Базовый путь: https://{IP_контроллера}/api/v1. Версия описания API: 1.7.0.

Примеры используют placeholder-значения для паролей, token, UUID, адресов и секретов. Перед выполнением запроса замените их на значения вашего контроллера.

Методы раздела

МетодПуть
GET/notification_channels
POST/notification_channels
GET/notification_channels/{id}
PUT/notification_channels/{id}
DELETE/notification_channels/{id}

GET /notification_channels

Раздел: Каналы уведомлений.

Возвращает список каналов уведомлений.

Параметры и ответы по OpenAPI
{
"description": "Returns list of Notification Channels",
"responses": {
"200": {
"description": "Successfully returned all installed Notification Channels",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"type",
"name"
],
"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}$"
},
"type": {
"type": "string",
"enum": [
"TELEGRAM",
"SMS",
"EMAIL"
],
"description": "Channel type"
},
"send_to_events_journal": {
"type": "boolean",
"description": "Send to events journal flag"
},
"token": {
"type": "string",
"description": "Telegram channel bot token"
},
"name": {
"type": "string",
"description": "Channel name"
}
}
}
}
}
}
},
"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_channels" \
-H "Authorization: Bearer <token>"

Пример ответа

[
{
"uuid": "string",
"type": "TELEGRAM",
"send_to_events_journal": true,
"token": "string",
"name": "string"
}
]

POST /notification_channels

Раздел: Каналы уведомлений.

Создает канал уведомлений.

Параметры и ответы по OpenAPI
{
"description": "Upload new channel",
"requestBody": {
"description": "JSON containing the new new channel",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"type",
"name"
],
"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}$"
},
"type": {
"type": "string",
"enum": [
"TELEGRAM",
"SMS",
"EMAIL"
],
"description": "Channel type"
},
"send_to_events_journal": {
"type": "boolean",
"description": "Send to events journal flag"
},
"token": {
"type": "string",
"description": "Telegram channel bot token"
},
"name": {
"type": "string",
"description": "Channel name"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful operation"
},
"400": {
"description": "Invalid JSON file"
}
}
}

Примеры по OpenAPI

Сформированы по схеме контроллера; значения полей необходимо заменить.

Пример запроса

curl -k -X POST "https://{IP_контроллера}/api/v1/notification_channels" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"type": "TELEGRAM",
"send_to_events_journal": true,
"token": "string",
"name": "string"
}'

Пример тела запроса

{
"uuid": "string",
"type": "TELEGRAM",
"send_to_events_journal": true,
"token": "string",
"name": "string"
}

GET /notification_channels/{id}

Раздел: Каналы уведомлений.

Возвращает канал уведомлений.

Параметры и ответы по OpenAPI
{
"description": "Get channel",
"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_channels/{id}" \
-H "Authorization: Bearer <token>"

PUT /notification_channels/{id}

Раздел: Каналы уведомлений.

Обновляет канал уведомлений.

Параметры и ответы по OpenAPI
{
"description": "Update channel",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "JSON containing the new SDK Module",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"type",
"name"
],
"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}$"
},
"type": {
"type": "string",
"enum": [
"TELEGRAM",
"SMS",
"EMAIL"
],
"description": "Channel type"
},
"send_to_events_journal": {
"type": "boolean",
"description": "Send to events journal flag"
},
"token": {
"type": "string",
"description": "Telegram channel bot token"
},
"name": {
"type": "string",
"description": "Channel name"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful operation"
},
"400": {
"description": "Bad request"
}
}
}

Примеры по OpenAPI

Сформированы по схеме контроллера; значения полей необходимо заменить.

Пример запроса

curl -k -X PUT "https://{IP_контроллера}/api/v1/notification_channels/{id}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"type": "TELEGRAM",
"send_to_events_journal": true,
"token": "string",
"name": "string"
}'

Пример тела запроса

{
"uuid": "string",
"type": "TELEGRAM",
"send_to_events_journal": true,
"token": "string",
"name": "string"
}

DELETE /notification_channels/{id}

Раздел: Каналы уведомлений.

Удаляет канал уведомлений.

Параметры и ответы по OpenAPI
{
"description": "Delete channel",
"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_channels/{id}" \
-H "Authorization: Bearer <token>"