События API 1.7.0
Методы API для работы с разделом «События».
Базовый путь: https://{IP_контроллера}/api/v1.
Версия описания API: 1.7.0.
Примеры используют placeholder-значения для паролей, token, UUID, адресов и секретов. Перед выполнением запроса замените их на значения вашего контроллера.
Методы раздела
GET /access_events
Раздел: События.
Возвращает постраничный список событий доступа
Назначение | URL запроса |
Возвращает постраничный список событий доступа | https://{IP_контроллера}/api/v1/access_events?from=1643057999999&page_size=10 |
Параметры запроса:
Наименование | Описание |
from* integer($int64) (query) to integer ($int64) (query) page_size* integer (query) cursor string (query) | UTC UNIX временная метка в миллисекундах, с которой учитывать события (включительно) UTC UNIX временная метка в миллисекундах, до которой учитывать события (включительно) Количество событий (строк) на страницу С какой строки начать поиск |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
timestamp | integer | $int64 | UNIX временная метка события в миллисекундах |
type* | string | minLength: 1
| Тип события аудита |
reason* | string | minLength: 1
| Причина события аудита |
object_type* | string | minLength: 1 | Тип объекта события аудита |
object_id* | string | minLength: 1 | ID объекта аудита |
object_name* | string | minLength: 1 | Описание события |
author_id* | string | minLength: 1 | Автор события |
author_name* | string | minLength: 1 | Автор события |
cursor* | string | Номер строки следующего поиска |
{
"events": [
{
"uuid": "string",
"timestamp": 0,
"type": "string",
"reason": "string",
"user_uuid": "string",
"user_name": "string",
"user_terra": "string",
"card_code": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"from": "string",
"to": "string",
"from_side": "a",
"tz_offset": 0,
"car_number": "string",
"pin": "ACCEPTED",
"request_ts": 0,
"response_ts": 0,
"access_point_privilege": 0
}
],
"cursor": "string"
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Return access events in specified interval sorted by timestamp in reverse order",
"parameters": [
{
"in": "query",
"name": "from",
"required": true,
"description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"in": "query",
"name": "to",
"required": false,
"description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"in": "query",
"name": "page_size",
"required": true,
"description": "Returned events max number",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 500
}
},
{
"in": "query",
"name": "cursor",
"required": false,
"description": "Search results cursor",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successfully returned events happened in specified time period",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"events",
"cursor"
],
"properties": {
"events": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"timestamp",
"type",
"reason",
"user_type",
"user_uuid",
"user_name",
"user_terra",
"card_code",
"access_point_uuid",
"access_point_name",
"access_point_privilege",
"from",
"to",
"from_side",
"tz_offset"
],
"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}$"
},
"timestamp": {
"type": "integer",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"type": "string",
"minLength": 1,
"description": "Access event type"
},
"reason": {
"type": "string",
"minLength": 1,
"description": "Access event type reason"
},
"user_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}$",
"description": "User UUID - who tried to pass some access point"
},
"user_name": {
"type": "string",
"minLength": 3,
"description": "User \\<surname>\\<name>\\<second_name>"
},
"user_terra": {
"type": "string",
"description": "User zone when event occured"
},
"card_code": {
"type": "string",
"description": "User card code"
},
"access_point_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}$"
},
"access_point_name": {
"type": "string",
"minLength": 1
},
"from": {
"type": "string",
"description": "Name of the territory from which transition occurred"
},
"to": {
"type": "string",
"description": "Name of the territory to which transition occurred"
},
"from_side": {
"type": "string",
"enum": [
"a",
"b"
],
"description": "Side from which access occured"
},
"tz_offset": {
"type": "integer",
"description": "Event time zone offset in minutes"
},
"car_number": {
"type": "string",
"description": "User car number from licence plates recognition analytics from ONVIF device"
},
"pin": {
"type": "string",
"enum": [
"ACCEPTED",
"REJECTED",
"DURESS"
],
"description": "If present, indicates that pin code was eneterd while access"
},
"request_ts": {
"type": "integer",
"format": "int64",
"description": "Access request UNIX timestamp in milliseconds"
},
"response_ts": {
"type": "integer",
"format": "int64",
"description": "Access response UNIX timestamp in milliseconds"
},
"access_point_privilege": {
"type": "number",
"description": "Access point privilege"
}
}
}
},
"cursor": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "Bad search parameters",
"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/access_events?from=1&page_size=1" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"events": [
{
"uuid": "string",
"timestamp": 1,
"type": "string",
"reason": "string",
"user_uuid": "string",
"user_name": "string",
"user_terra": "string",
"card_code": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"from": "string",
"to": "string",
"from_side": "a",
"tz_offset": 1,
"car_number": "string",
"pin": "ACCEPTED",
"request_ts": 1,
"response_ts": 1,
"access_point_privilege": 1.0
}
],
"cursor": "string"
}
GET /access_events/count
Раздел: События.
Возвращает количество событий доступа в системе за определенный период
Назначение | URL запроса |
Возвращает количество событий доступа в системе за определенный период | https://{IP_контроллера}/api/v1/access_events/count?from=1643057999999 |
Параметры запроса:
Наименование | Описание |
from* integer($int64) (query) to integer ($int64) (query) user_type string (query) | UTC UNIX временная метка в миллисекундах, с которой учитывать события (включительно) UTC UNIX временная метка в миллисекундах, до которой учитывать события (включительно) Тип пользователя |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"count": 0
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Return events count in specified interval",
"parameters": [
{
"in": "query",
"name": "from",
"required": true,
"description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"in": "query",
"name": "to",
"required": false,
"description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "user_type",
"in": "query",
"required": false,
"description": "Type of user visitor or staff",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successfully returned events count in specified time period",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"count"
],
"properties": {
"count": {
"type": "integer",
"minimum": 0
}
}
}
}
}
},
"400": {
"description": "Bad search parameters",
"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/access_events/count?from=1" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"count": 1
}
GET /access_events/types
Раздел: События.
Возвращает список доступных типов событий доступа
Назначение | URL запроса |
Возвращает список доступных типов событий доступа | https://{IP_контроллера}/api/v1/access_events/types |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
type* | string | Тип события | |
reason* | string | Причина события | |
description* | string | Описание события |
[
{
"type": "string",
"reason": "string",
"description": "string"
}
]
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Get available events types list",
"responses": {
"200": {
"description": "Successfully got events types",
"content": {
"application/json": {
"schema": {
"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/access_events/types" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"type": "string",
"reason": "string",
"description": "string"
}
]
POST /access_events/user_defined
Раздел: События.
Добавляет пользовательское событие с типом «Доступ»
Назначение | URL запроса |
Добавляет пользовательское событие с типом «Доступ» (access_events) | https://{IP_контроллера}/api/v1/access_events/user_defined/ |
Параметры запроса:
Параметры отсутствуют
В теле запроса доступны три варианта, в зависимости от типа (Type) события
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
TYPE* | string | [ ALLOWED, FORBIDDEN] | Тип события (полный список типов и причин доступен по get запросу /access_events/types): * |
reason* | string | [ ACCESS POINT - Разрешен проход через личную точку прохода, | Причина события (полный список причин доступен по get запросу /access_events/types) |
req_id | number | идентификатор запроса | |
user_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | UUID персоны |
user_type* | string | [ staff - сотрудник, | Тип персоны |
identifier_format* | string | [ card - карта, qr - qr код, barcode - штрихкод, ] | Формат идентификатора |
user_name* | string | minLength: 3 | ФИО персоны <surname><name><second_name> |
user_terra* | string | example: 1:1:1:Внешняя | Зона, здание и этаж точки прохода по которой происходит событие доступа |
from* | string | example: 1:1:1 | Зона выхода |
to* | string | example: 1:1:1:Внешняя | Зона входа |
from_side* | string | [a,b] | Сторона с которой был совершен проход |
access_point_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | uuid точки прохода |
access_point_name* | string | minLength: 1 | Название точки прохода |
access_point_privilege* | number | Уровень привилегий точки прохода | |
timestamp* | number | $int64 | UNIX временная метка события в миллисекундах |
tz_offset* | number | Смещение часового пояса события в минутах | |
card_code | string | код карты | |
card_privilege | number | уровень привилегий карты | |
request_ts* | number | $int64 | UNIX временная метка в миллисекундах запроса доступа |
api_request_from | string | Источник запроса к API | |
car_number | string | Гос номер авто | |
pin | string | Пин-код | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
TYPE* | string | [ REQUEST] | Тип события (полный список типов и причин доступен по get запросу /access_events/types): |
reason* | string | [ ACCESS REQUEST - Запрос на доступ через точку прохода, | Причина события (полный список причин доступен по get запросу /access_events/types) |
req_id | number | идентификатор запроса | |
user_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | UUID пероны |
user_type* | string | [ staff - сотрудник, visitor - посетитель ] | Тип персоны |
identifier_format* | string | [ card - карта, qr - qr код, barcode - штрихкод, ] | Формат идентификатора |
user_name* | string | minLength: 3 | ФИО персоны <surname><name><second_name> |
user_terra* | string | example: 1:1:1:Внешняя | Зона, здание и этаж точки прохода по которой происходит событие доступа |
from* | string | example: 1:1:1 | Зона выхода |
to* | string | example: 1:1:1:Внешняя | Зона входа |
from_side* | string | [a,b] | Сторона с которой был совершен проход |
access_point_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | uuid точки прохода |
access_point_name* | string | minLength: 1 | Название точки прохода |
access_point_privilege* | number | Уровень привилегий точки прохода | |
timestamp* | number | $int64 | UNIX временная метка события в миллисекундах |
tz_offset* | number | Смещение часового пояса события в минутах | |
card_code | string | код карты | |
card_privilege | number | уровень привилегий карты | |
identification_method | string | [ card_and_pin - карта и ПИН-код, | UNIX временная метка в миллисекундах запроса доступа |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
TYPE* | string | [ EXECUTED, UNEXECUTED, PARTIALLY EXECUTED ] | Тип события (полный список типов и причин доступен по get запросу /access_events/types): |
reason* | string | [ ACCESS POINT - Совершен проход через личную точку прохода, | Причина события (полный список причин доступен по get запросу /access_events/types) |
req_id | number | идентификатор запроса | |
user_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | UUID пероны |
user_type* | string | [ staff - сотрудник, visitor - посетитель ] | Тип персоны |
identifier_format* | string | [ card - карта, qr - qr код, barcode - штрихкод, ] | Формат идентификатора |
user_name* | string | minLength: 3 | ФИО персоны <surname><name><second_name> |
user_terra* | string | example: 1:1:1:Внешняя | Зона, здание и этаж точки прохода по которой происходит событие доступа |
from* | string | example: 1:1:1 | Зона выхода |
to* | string | example: 1:1:1:Внешняя | Зона входа |
from_side* | string | [a,b] | Сторона с которой был совершен проход |
access_point_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | uuid точки прохода |
access_point_name* | string | minLength: 1 | Название точки прохода |
access_point_privilege* | number | Уровень привилегий точки прохода | |
timestamp* | number | $int64 | UNIX временная метка события в миллисекундах |
tz_offset* | number | Смещение часового пояса события в минутах | |
card_code | string | код карты | |
card_privilege | number | уровень привилегий карты | |
response_ts* | number | $int64 | UNIX временная метка в миллисекундах ответа на запрос доступа |
request_ts* | number | $int64 | UNIX временная метка в миллисекундах запроса доступа |
Пример:
URL запроса: POST
https://{IP_контроллера}/api/v1/access_events/user_defined
Body
{
"uuid": "string",
"type": "ALLOWED",
"reason": "ACCESS POINT",
"req_id": 0,
"user_uuid": "string",
"user_type": "staff",
"identifier_format": "card",
"user_name": "string",
"user_terra": "1:1:1:Внешняя",
"from": "1:1:1",
"to": "1:1:1:Внешняя",
"from_side": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"access_point_privilege": 0,
"timestamp": 0,
"tz_offset": 0,
"card_code": "string",
"card_privilege": 0,
"request_ts": 0,
"api_request_from": "string",
"car_number": "string",
"pin": "string"
}
Варианты ответа:
Code 201 (Successfully) - удачное выполнение запроса
{
"success": true,
"message": "string"
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (User with specified login already exists) - запрос не выполнен, пользователь с таким именем уже добавлен
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Code 404
(User with specified uuid was not found) - запрос не выполнен, пользователь указанный в {uuid} не найден
(Specified device does not exist) - запрос не выполнен, указанное устройство не существует
(Specified access point does not exist) - запрос не выполнен, указанная точка прохода не существует
Code 409 (User with specified uuid already exists) - запрос не выполнен, пользователь с таким uuid уже добавлен
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Add new user defined access",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"type": "object",
"required": [
"user_uuid",
"user_type",
"identifier_format",
"user_name",
"user_terra",
"from",
"to",
"from_side",
"access_point_uuid",
"access_point_name",
"access_point_privilege",
"timestamp",
"tz_offset",
"type",
"reason",
"request_ts"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"type": {
"type": "string",
"enum": [
"ALLOWED",
"FORBIDDEN"
],
"description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n *`ALLOWED` - Разрешен проход\n *`FORBIDDEN` - Доступ запрещен (причина в поле reason)\n"
},
"reason": {
"type": "string",
"enum": [
"ACCESS POINT",
"ACCESS PROFILE",
"EXTERNAL ACCESS",
"PIN CODE",
"BUTTON PRESSED",
"REMOTE BUTTON PRESSED",
"ACCESS POINT UNBLOCKED",
"ACCESS POINT SIDE A UNBLOCKED",
"ACCESS POINT SIDE B UNBLOCKED",
"DURESS PIN CODE",
"TEMPORARY ACCESS",
"CONFIRM BUTTON PRESSED",
"EXTERNAL RESOLUTION",
"CARD CONFIRM"
],
"description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
},
"req_id": {
"type": "number"
},
"user_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"user_type": {
"type": "string",
"enum": [
"staff",
"visitor"
]
},
"identifier_format": {
"type": "string",
"enum": [
"card",
"qr",
"barcode",
""
]
},
"user_name": {
"type": "string"
},
"user_terra": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from": {
"type": "string",
"example": "1:1:1"
},
"to": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from_side": {
"type": "string"
},
"access_point_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"access_point_name": {
"type": "string"
},
"access_point_privilege": {
"type": "number"
},
"timestamp": {
"type": "number"
},
"tz_offset": {
"type": "number"
},
"card_code": {
"type": "string"
},
"card_privilege": {
"type": "number"
},
"request_ts": {
"type": "number"
},
"api_request_from": {
"type": "string"
},
"car_number": {
"type": "string"
},
"pin": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"user_uuid",
"user_type",
"identifier_format",
"user_name",
"user_terra",
"from",
"to",
"from_side",
"access_point_uuid",
"access_point_name",
"access_point_privilege",
"timestamp",
"tz_offset",
"type",
"reason"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"type": {
"type": "string",
"enum": [
"REQUEST"
],
"description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n *`REQUEST` - Запрос на проход или доступ\n"
},
"reason": {
"type": "string",
"enum": [
"ACCESS REQUEST",
"BUTTON PRESSED",
"REMOTE BUTTON PRESSED",
"CARD CONFIRM"
],
"description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
},
"req_id": {
"type": "number"
},
"user_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"user_type": {
"type": "string",
"enum": [
"staff",
"visitor"
]
},
"identifier_format": {
"type": "string",
"enum": [
"card",
"qr",
"barcode",
""
]
},
"user_name": {
"type": "string"
},
"user_terra": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from": {
"type": "string",
"example": "1:1:1"
},
"to": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from_side": {
"type": "string"
},
"access_point_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"access_point_name": {
"type": "string"
},
"access_point_privilege": {
"type": "number"
},
"timestamp": {
"type": "number"
},
"tz_offset": {
"type": "number"
},
"card_code": {
"type": "string"
},
"card_privilege": {
"type": "number"
},
"identification_method": {
"type": "string",
"enum": [
"card_and_pin",
"card",
"multi_factor",
"lpr",
"pin",
"lpr_and_card",
"card_or_pin",
"bio",
"card_and_bio",
"card_and_pin_and_bio"
]
}
}
},
{
"type": "object",
"required": [
"user_uuid",
"user_type",
"identifier_format",
"user_name",
"user_terra",
"from",
"to",
"from_side",
"access_point_uuid",
"access_point_name",
"access_point_privilege",
"timestamp",
"tz_offset",
"type",
"reason",
"response_ts",
"request_ts"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"type": {
"type": "string",
"enum": [
"EXECUTED",
"UNEXECUTED",
"PARTIALLY EXECUTED"
],
"description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n *`EXECUTED` - Cовершен проход\n *`PARTIALLY EXECUTED` - Частично совершен проход\n *`UNEXECUTED` - Не совершенный проход\n"
},
"reason": {
"type": "string",
"enum": [
"ACCESS POINT",
"ACCESS PROFILE",
"EXTERNAL ACCESS",
"PIN CODE",
"BUTTON PRESSED",
"REMOTE BUTTON PRESSED",
"ACCESS POINT UNBLOCKED",
"ACCESS POINT SIDE A UNBLOCKED",
"ACCESS POINT SIDE B UNBLOCKED",
"DURESS PIN CODE",
"TEMPORARY ACCESS",
"EXTERNAL RESOLUTION",
"CARD CONFIRM",
"CONFIRM BUTTON PRESSED"
],
"description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
},
"req_id": {
"type": "number"
},
"user_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"user_type": {
"type": "string",
"enum": [
"staff",
"visitor"
]
},
"identifier_format": {
"type": "string",
"enum": [
"card",
"qr",
"barcode",
""
]
},
"user_name": {
"type": "string"
},
"user_terra": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from": {
"type": "string",
"example": "1:1:1"
},
"to": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from_side": {
"type": "string"
},
"access_point_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"access_point_name": {
"type": "string"
},
"access_point_privilege": {
"type": "number"
},
"timestamp": {
"type": "number"
},
"tz_offset": {
"type": "number"
},
"card_code": {
"type": "string"
},
"card_privilege": {
"type": "number"
},
"response_ts": {
"type": "number"
},
"request_ts": {
"type": "number"
}
}
}
]
}
}
}
},
"responses": {
"201": {
"description": "Successfully created new user defined access",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
},
"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}$"
}
}
}
}
}
},
"400": {
"description": "Bad parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"409": {
"description": "Access with specified UUID already exists",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X POST "https://{IP_контроллера}/api/v1/access_events/user_defined" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"type": "ALLOWED",
"reason": "ACCESS POINT",
"req_id": 1.0,
"user_uuid": "string",
"user_type": "staff",
"identifier_format": "card",
"user_name": "string",
"user_terra": "1:1:1:Внешняя",
"from": "1:1:1",
"to": "1:1:1:Внешняя",
"from_side": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"access_point_privilege": 1.0,
"timestamp": 1.0,
"tz_offset": 1.0,
"card_code": "string",
"card_privilege": 1.0,
"request_ts": 1.0,
"api_request_from": "string",
"car_number": "string",
"pin": "string"
}'
Пример тела запроса
{
"uuid": "string",
"type": "ALLOWED",
"reason": "ACCESS POINT",
"req_id": 1.0,
"user_uuid": "string",
"user_type": "staff",
"identifier_format": "card",
"user_name": "string",
"user_terra": "1:1:1:Внешняя",
"from": "1:1:1",
"to": "1:1:1:Внешняя",
"from_side": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"access_point_privilege": 1.0,
"timestamp": 1.0,
"tz_offset": 1.0,
"card_code": "string",
"card_privilege": 1.0,
"request_ts": 1.0,
"api_request_from": "string",
"car_number": "string",
"pin": "string"
}
Пример ответа
{
"success": true,
"message": "string",
"uuid": "string"
}
PUT /access_events/user_defined/{uuid}
Раздел: События.
Редактирует существующее пользовательское событие доступа
Назначение | URL запроса |
Редактирует существующее пользовательское событие доступа | https://{IP_контроллера}/api/v1/access_events/user_defined/{uuid} |
Параметры запроса:
Название | Тип | Описание | |
uuid* access* | string (path) object (body) | uuid события доступа тело запроса. Доступно три варианта, в зависимости от типа (TYPE) события | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
TYPE* | string | [ ALLOWED, FORBIDDEN] | Тип события (полный список типов и причин доступен по get запросу /access_events/types): * |
reason* | string | [ ACCESS POINT - Разрешен проход через личную точку прохода, | Причина события (полный список причин доступен по get запросу /access_events/types) |
req_id | number | идентификатор запроса | |
user_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | UUID персоны |
user_type* | string | [ staff - сотрудник, | Тип персоны |
identifier_format* | string | [ card - карта, qr - qr код, barcode - штрихкод, ] | Формат идентификатора |
user_name* | string | minLength: 3 | ФИО персоны <surname><name><second_name> |
user_terra* | string | example: 1:1:1:Внешняя | Зона, здание и этаж точки прохода по которой происходит событие доступа |
from* | string | example: 1:1:1 | Зона выхода |
to* | string | example: 1:1:1:Внешняя | Зона входа |
from_side* | string | [a,b] | Сторона с которой был совершен проход |
access_point_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | uuid точки прохода |
access_point_name* | string | minLength: 1 | Название точки прохода |
access_point_privilege* | number | Уровень привилегий точки прохода | |
timestamp* | number | $int64 | UNIX временная метка события в миллисекундах |
tz_offset* | number | Смещение часового пояса события в минутах | |
card_code | string | код карты | |
card_privilege | number | уровень привилегий карты | |
request_ts* | number | $int64 | UNIX временная метка в миллисекундах запроса доступа |
api_request_from | string | Источник запроса к API | |
car_number | string | Гос номер авто | |
pin | string | Пин-код | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
TYPE* | string | [ REQUEST] | Тип события (полный список типов и причин доступен по get запросу /access_events/types): |
reason* | string | [ ACCESS REQUEST - Запрос на доступ через точку прохода, | Причина события (полный список причин доступен по get запросу /access_events/types) |
req_id | number | идентификатор запроса | |
user_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | UUID пероны |
user_type* | string | [ staff - сотрудник, visitor - посетитель ] | Тип персоны |
identifier_format* | string | [ card - карта, qr - qr код, barcode - штрихкод, ] | Формат идентификатора |
user_name* | string | minLength: 3 | ФИО персоны <surname><name><second_name> |
user_terra* | string | example: 1:1:1:Внешняя | Зона, здание и этаж точки прохода по которой происходит событие доступа |
from* | string | example: 1:1:1 | Зона выхода |
to* | string | example: 1:1:1:Внешняя | Зона входа |
from_side* | string | [a,b] | Сторона с которой был совершен проход |
access_point_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | uuid точки прохода |
access_point_name* | string | minLength: 1 | Название точки прохода |
access_point_privilege* | number | Уровень привилегий точки прохода | |
timestamp* | number | $int64 | UNIX временная метка события в миллисекундах |
tz_offset* | number | Смещение часового пояса события в минутах | |
card_code | string | код карты | |
card_privilege | number | уровень привилегий карты | |
identification_method | string | [ card_and_pin - карта и ПИН-код, | UNIX временная метка в миллисекундах запроса доступа |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
TYPE* | string | [ EXECUTED, UNEXECUTED, PARTIALLY EXECUTED ] | Тип события (полный список типов и причин доступен по get запросу /access_events/types): |
reason* | string | [ ACCESS POINT - Совершен проход через личную точку прохода, | Причина события (полный список причин доступен по get запросу /access_events/types) |
req_id | number | идентификатор запроса | |
user_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | UUID пероны |
user_type* | string | [ staff - сотрудник, visitor - посетитель ] | Тип персоны |
identifier_format* | string | [ card - карта, qr - qr код, barcode - штрихкод, ] | Формат идентификатора |
user_name* | string | minLength: 3 | ФИО персоны <surname><name><second_name> |
user_terra* | string | example: 1:1:1:Внешняя | Зона, здание и этаж точки прохода по которой происходит событие доступа |
from* | string | example: 1:1:1 | Зона выхода |
to* | string | example: 1:1:1:Внешняя | Зона входа |
from_side* | string | [a,b] | Сторона с которой был совершен проход |
access_point_uuid* | string | pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ | uuid точки прохода |
access_point_name* | string | minLength: 1 | Название точки прохода |
access_point_privilege* | number | Уровень привилегий точки прохода | |
timestamp* | number | $int64 | UNIX временная метка события в миллисекундах |
tz_offset* | number | Смещение часового пояса события в минутах | |
card_code | string | код карты | |
card_privilege | number | уровень привилегий карты | |
response_ts* | number | $int64 | UNIX временная метка в миллисекундах ответа на запрос доступа |
request_ts* | number | $int64 | UNIX временная метка в миллисекундах запроса доступа |
Пример:
URL запроса: PUT
https://{IP_контроллера}/api/v1/access_events/user_defined/{uuid}
Body:
{
"uuid": "string",
"type": "ALLOWED",
"reason": "ACCESS POINT",
"req_id": 0,
"user_uuid": "string",
"user_type": "staff",
"identifier_format": "card",
"user_name": "string",
"user_terra": "1:1:1:Внешняя",
"from": "1:1:1",
"to": "1:1:1:Внешняя",
"from_side": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"access_point_privilege": 0,
"timestamp": 0,
"tz_offset": 0,
"card_code": "string",
"card_privilege": 0,
"request_ts": 0,
"api_request_from": "string",
"car_number": "string",
"pin": "string"
}
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404
(User with specified uuid was not found) - запрос не выполнен, пользователь указанный в {uuid} не найден
(Specified device does not exist) - запрос не выполнен, указанное устройство не существует
(Specified access point does not exist) - запрос не выполнен, указанная точка прохода не существует
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Update specified user defined access data",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
"example": "123e4567-e89b-12d3-a456-426614174000"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"type": "object",
"required": [
"user_uuid",
"user_type",
"identifier_format",
"user_name",
"user_terra",
"from",
"to",
"from_side",
"access_point_uuid",
"access_point_name",
"access_point_privilege",
"timestamp",
"tz_offset",
"type",
"reason",
"request_ts"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"type": {
"type": "string",
"enum": [
"ALLOWED",
"FORBIDDEN"
],
"description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n *`ALLOWED` - Разрешен проход\n *`FORBIDDEN` - Доступ запрещен (причина в поле reason)\n"
},
"reason": {
"type": "string",
"enum": [
"ACCESS POINT",
"ACCESS PROFILE",
"EXTERNAL ACCESS",
"PIN CODE",
"BUTTON PRESSED",
"REMOTE BUTTON PRESSED",
"ACCESS POINT UNBLOCKED",
"ACCESS POINT SIDE A UNBLOCKED",
"ACCESS POINT SIDE B UNBLOCKED",
"DURESS PIN CODE",
"TEMPORARY ACCESS",
"CONFIRM BUTTON PRESSED",
"EXTERNAL RESOLUTION",
"CARD CONFIRM"
],
"description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
},
"req_id": {
"type": "number"
},
"user_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"user_type": {
"type": "string",
"enum": [
"staff",
"visitor"
]
},
"identifier_format": {
"type": "string",
"enum": [
"card",
"qr",
"barcode",
""
]
},
"user_name": {
"type": "string"
},
"user_terra": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from": {
"type": "string",
"example": "1:1:1"
},
"to": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from_side": {
"type": "string"
},
"access_point_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"access_point_name": {
"type": "string"
},
"access_point_privilege": {
"type": "number"
},
"timestamp": {
"type": "number"
},
"tz_offset": {
"type": "number"
},
"card_code": {
"type": "string"
},
"card_privilege": {
"type": "number"
},
"request_ts": {
"type": "number"
},
"api_request_from": {
"type": "string"
},
"car_number": {
"type": "string"
},
"pin": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"user_uuid",
"user_type",
"identifier_format",
"user_name",
"user_terra",
"from",
"to",
"from_side",
"access_point_uuid",
"access_point_name",
"access_point_privilege",
"timestamp",
"tz_offset",
"type",
"reason"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"type": {
"type": "string",
"enum": [
"REQUEST"
],
"description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n *`REQUEST` - Запрос на проход или доступ\n"
},
"reason": {
"type": "string",
"enum": [
"ACCESS REQUEST",
"BUTTON PRESSED",
"REMOTE BUTTON PRESSED",
"CARD CONFIRM"
],
"description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
},
"req_id": {
"type": "number"
},
"user_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"user_type": {
"type": "string",
"enum": [
"staff",
"visitor"
]
},
"identifier_format": {
"type": "string",
"enum": [
"card",
"qr",
"barcode",
""
]
},
"user_name": {
"type": "string"
},
"user_terra": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from": {
"type": "string",
"example": "1:1:1"
},
"to": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from_side": {
"type": "string"
},
"access_point_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"access_point_name": {
"type": "string"
},
"access_point_privilege": {
"type": "number"
},
"timestamp": {
"type": "number"
},
"tz_offset": {
"type": "number"
},
"card_code": {
"type": "string"
},
"card_privilege": {
"type": "number"
},
"identification_method": {
"type": "string",
"enum": [
"card_and_pin",
"card",
"multi_factor",
"lpr",
"pin",
"lpr_and_card",
"card_or_pin",
"bio",
"card_and_bio",
"card_and_pin_and_bio"
]
}
}
},
{
"type": "object",
"required": [
"user_uuid",
"user_type",
"identifier_format",
"user_name",
"user_terra",
"from",
"to",
"from_side",
"access_point_uuid",
"access_point_name",
"access_point_privilege",
"timestamp",
"tz_offset",
"type",
"reason",
"response_ts",
"request_ts"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"type": {
"type": "string",
"enum": [
"EXECUTED",
"UNEXECUTED",
"PARTIALLY EXECUTED"
],
"description": "Тип события (полный список типов и причин доступен по get запросу /access_events/types):\n *`EXECUTED` - Cовершен проход\n *`PARTIALLY EXECUTED` - Частично совершен проход\n *`UNEXECUTED` - Не совершенный проход\n"
},
"reason": {
"type": "string",
"enum": [
"ACCESS POINT",
"ACCESS PROFILE",
"EXTERNAL ACCESS",
"PIN CODE",
"BUTTON PRESSED",
"REMOTE BUTTON PRESSED",
"ACCESS POINT UNBLOCKED",
"ACCESS POINT SIDE A UNBLOCKED",
"ACCESS POINT SIDE B UNBLOCKED",
"DURESS PIN CODE",
"TEMPORARY ACCESS",
"EXTERNAL RESOLUTION",
"CARD CONFIRM",
"CONFIRM BUTTON PRESSED"
],
"description": "Причина события (полный список причин доступен по get запросу /access_events/types)"
},
"req_id": {
"type": "number"
},
"user_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"user_type": {
"type": "string",
"enum": [
"staff",
"visitor"
]
},
"identifier_format": {
"type": "string",
"enum": [
"card",
"qr",
"barcode",
""
]
},
"user_name": {
"type": "string"
},
"user_terra": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from": {
"type": "string",
"example": "1:1:1"
},
"to": {
"type": "string",
"example": "1:1:1:Внешняя"
},
"from_side": {
"type": "string"
},
"access_point_uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"access_point_name": {
"type": "string"
},
"access_point_privilege": {
"type": "number"
},
"timestamp": {
"type": "number"
},
"tz_offset": {
"type": "number"
},
"card_code": {
"type": "string"
},
"card_privilege": {
"type": "number"
},
"response_ts": {
"type": "number"
},
"request_ts": {
"type": "number"
}
}
}
]
}
}
}
},
"responses": {
"200": {
"description": "Successfully update user defined access data",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified user defined access does not exist",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X PUT "https://{IP_контроллера}/api/v1/access_events/user_defined/{uuid}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"type": "ALLOWED",
"reason": "ACCESS POINT",
"req_id": 1.0,
"user_uuid": "string",
"user_type": "staff",
"identifier_format": "card",
"user_name": "string",
"user_terra": "1:1:1:Внешняя",
"from": "1:1:1",
"to": "1:1:1:Внешняя",
"from_side": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"access_point_privilege": 1.0,
"timestamp": 1.0,
"tz_offset": 1.0,
"card_code": "string",
"card_privilege": 1.0,
"request_ts": 1.0,
"api_request_from": "string",
"car_number": "string",
"pin": "string"
}'
Пример тела запроса
{
"uuid": "string",
"type": "ALLOWED",
"reason": "ACCESS POINT",
"req_id": 1.0,
"user_uuid": "string",
"user_type": "staff",
"identifier_format": "card",
"user_name": "string",
"user_terra": "1:1:1:Внешняя",
"from": "1:1:1",
"to": "1:1:1:Внешняя",
"from_side": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"access_point_privilege": 1.0,
"timestamp": 1.0,
"tz_offset": 1.0,
"card_code": "string",
"card_privilege": 1.0,
"request_ts": 1.0,
"api_request_from": "string",
"car_number": "string",
"pin": "string"
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
DELETE /access_events/user_defined/{uuid}
Раздел: События.
Удаляет указанный пользовательский доступ по UUID
Назначение | URL запроса |
Удаляет указанный пользовательский доступ | https://{IP_контроллера}/api/v1/access_events/user_defined/{uuid} |
Параметры запроса:
Наименование, * - обязательный | Описание |
uuid * string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified user defined access does not exist) - запрос не выполнен, указанное событие не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Delete specified user defined access",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
],
"responses": {
"200": {
"description": "Successfully deleted user defined access",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified user defined access does not exist",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X DELETE "https://{IP_контроллера}/api/v1/access_events/user_defined/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /access_events/{uuid}
Раздел: События.
Возвращает данные конкретного события доступа по uuid
Назначение | URL запроса |
Возвращает данные конкретного события доступа по uuid | https://{IP_контроллера}/api/v1/access_events/b0de19a1-fcd2-42fd-9b13-500c21d8b057 |
Параметры запроса:
Наименование | Описание |
uuid* string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
timestamp* | integer | $int64 | UNIX временная метка в миллисекундах |
type* | string | minLength: 1 | Тип события доступа |
reason* | string | minLength: 1 | Причина события доступа |
user_uuid* | string | UUID сотрудника который совершил попытку прохода по какой-либо точке | |
user_name* | string | minLength: 3 | ФИО сотрудника <фамилия><имя><отчество> |
user_terra* | string | Зона, здание и этаж прохода сотрудника | |
card_code* | string | Номер карты сотрудника | |
access_point_uuid* | string | UUID точки прохода сотрудника | |
access_point_name* | string | minLength: 1 | Название точки прохода сотрудника |
from* | string | Зона выхода | |
to* | string | Зона входа | |
from_side* | string | [ a, b ] | Сторона с которой был совершен проход |
tz_offset* | integer | Смещение часового пояса события в минутах | |
car_number | string | Номер автомобиля из распознавания номерных знаков с устройства ONVIF | |
pin | string | [ACCEPTED, REJECTED, DURESS] | Сообщает о факте введения ПИН-кода |
request_ts | integer | $int64 | UNIX временная метка в миллисекундах запроса доступа |
response_ts | integer | $int64 | UNIX временная метка в миллисекундах ответа на запрос доступа |
access_point_privilege* | number | Уровень привилегий точки прохода |
{
"uuid": "string",
"timestamp": 0,
"type": "string",
"reason": "string",
"user_uuid": "string",
"user_name": "string",
"user_terra": "string",
"card_code": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"from": "string",
"to": "string",
"from_side": "a",
"tz_offset": 0,
"car_number": "string",
"pin": "ACCEPTED",
"request_ts": 0,
"response_ts": 0,
"access_point_privilege": 0
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified device does not exist) - запрос не выполнен, указанное событие не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns access event with specified UUID",
"parameters": [
{
"name": "uuid",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Audit event uuid"
}
],
"responses": {
"200": {
"description": "Successfully got event with specified UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"timestamp",
"type",
"reason",
"user_type",
"user_uuid",
"user_name",
"user_terra",
"card_code",
"access_point_uuid",
"access_point_name",
"access_point_privilege",
"from",
"to",
"from_side",
"tz_offset"
],
"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}$"
},
"timestamp": {
"type": "integer",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"type": "string",
"minLength": 1,
"description": "Access event type"
},
"reason": {
"type": "string",
"minLength": 1,
"description": "Access event type reason"
},
"user_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}$",
"description": "User UUID - who tried to pass some access point"
},
"user_name": {
"type": "string",
"minLength": 3,
"description": "User \\<surname>\\<name>\\<second_name>"
},
"user_terra": {
"type": "string",
"description": "User zone when event occured"
},
"card_code": {
"type": "string",
"description": "User card code"
},
"access_point_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}$"
},
"access_point_name": {
"type": "string",
"minLength": 1
},
"from": {
"type": "string",
"description": "Name of the territory from which transition occurred"
},
"to": {
"type": "string",
"description": "Name of the territory to which transition occurred"
},
"from_side": {
"type": "string",
"enum": [
"a",
"b"
],
"description": "Side from which access occured"
},
"tz_offset": {
"type": "integer",
"description": "Event time zone offset in minutes"
},
"car_number": {
"type": "string",
"description": "User car number from licence plates recognition analytics from ONVIF device"
},
"pin": {
"type": "string",
"enum": [
"ACCEPTED",
"REJECTED",
"DURESS"
],
"description": "If present, indicates that pin code was eneterd while access"
},
"request_ts": {
"type": "integer",
"format": "int64",
"description": "Access request UNIX timestamp in milliseconds"
},
"response_ts": {
"type": "integer",
"format": "int64",
"description": "Access response UNIX timestamp in milliseconds"
},
"access_point_privilege": {
"type": "number",
"description": "Access point privilege"
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified event was not found",
"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/access_events/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"uuid": "string",
"timestamp": 1,
"type": "string",
"reason": "string",
"user_uuid": "string",
"user_name": "string",
"user_terra": "string",
"card_code": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"from": "string",
"to": "string",
"from_side": "a",
"tz_offset": 1,
"car_number": "string",
"pin": "ACCEPTED",
"request_ts": 1,
"response_ts": 1,
"access_point_privilege": 1.0
}
GET /alert-notification-filters/access/{uuid}
Раздел: События.
Возвращает события доступа с настроенными уведомлениями по UUID
Назначение | URL запроса |
Возвращает список событий доступа с настроенными уведомлениями по UUID | https://{IP_контроллера}/api/v1/alert-notification-filters/access/{uuid} |
Параметры запроса:
Наименование, * - обязательный | Описание |
uuid* string ($uuid) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | Уникальный идентификатор | |
properties* | string | name, access_point_uuid, type, enum | Свойства события |
actions | string | Действия | |
active | boolean | Состояние события |
{
"uuid": "string",
"properties": {
"name": {
"type": "string",
"enum": [
"string"
]
},
"access_point_uuid": {
"type": "string",
"enum": [
"string"
]
},
"user_uuid": {
"type": "string",
"enum": [
"string"
]
}
},
"actions": [
{
"name": "string",
"props": {}
}
],
"active": true
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified event was not found) - запрос не выполнен, указанное событие не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns access event filter with specified UUID",
"parameters": [
{
"name": "uuid",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "access event filter uuid"
}
],
"responses": {
"200": {
"description": "Successfully got event with specified UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"properties"
],
"properties": {
"uuid": {
"type": "string",
"description": "Уникальный идентификатор"
},
"properties": {
"type": "object",
"properties": {
"name": {
"type": "object",
"required": [
"type",
"enum"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"access_point_uuid": {
"type": "object",
"required": [
"type",
"enum"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"user_uuid": {
"type": "object",
"required": [
"type",
"enum"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"actions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"props": {
"type": "object"
}
}
}
},
"active": {
"type": "boolean"
}
},
"additionalProperties": false
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified event was not found",
"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/alert-notification-filters/access/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"uuid": "string",
"properties": {
"name": {
"type": "string",
"enum": [
"string"
]
},
"access_point_uuid": {
"type": "string",
"enum": [
"string"
]
},
"user_uuid": {
"type": "string",
"enum": [
"string"
]
}
},
"actions": [
{
"name": "string",
"props": {}
}
],
"active": true
}
DELETE /alert-notification-filters/access/{uuid}
Раздел: События.
Удаляет фильтр событий доступа по UUID
Назначение | URL запроса |
Удаляет фильтр событий доступа | https://{IP_контроллера}/api/v1/alert-notification-filters/access/{uuid} |
Параметры запроса:
Наименование, * - обязательный | Описание |
uuid * string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (User with specified uuid was not found) - запрос не выполнен, пользователь указанный в {uuid} не найден
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Delete access event filter",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "access event filter successfully deleted",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified access event filter does not exist",
"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 DELETE "https://{IP_контроллера}/api/v1/alert-notification-filters/access/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /alert-notification-filters/audit/{uuid}
Раздел: События.
Возвращает события аудита с настроенными уведомлениями по UUID
Назначение | URL запроса |
Возвращает события аудита с настроенными уведомлениями по UUID | https://{IP_контроллера}/api/v1/alert-notification-filters/audit/{uuid} |
Параметры запроса:
Наименование, * - обязательный | Описание |
uuid* string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | Уникальный идентификатор | |
properties* | string | name, access_point_uuid, type, enum | Свойства события |
actions | string | Действия | |
active | boolean | Состояние события |
{
"uuid": "string",
"properties": {
"name": {
"type": "string",
"enum": [
"string"
]
},
"access_point_uuid": {
"type": "string",
"enum": [
"string"
]
},
"user_uuid": {
"type": "string",
"enum": [
"string"
]
}
},
"actions": [
{
"name": "string",
"props": {}
}
],
"active": true
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified event was not found) - запрос не выполнен, указанное событие не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns access event filter with specified UUID",
"parameters": [
{
"name": "uuid",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "access event filter uuid"
}
],
"responses": {
"200": {
"description": "Successfully got event with specified UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"properties"
],
"properties": {
"uuid": {
"type": "string",
"description": "Уникальный идентификатор"
},
"properties": {
"type": "object",
"properties": {
"name": {
"type": "object",
"required": [
"type",
"enum"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"access_point_uuid": {
"type": "object",
"required": [
"type",
"enum"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"user_uuid": {
"type": "object",
"required": [
"type",
"enum"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"actions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"props": {
"type": "object"
}
}
}
},
"active": {
"type": "boolean"
}
},
"additionalProperties": false
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified event was not found",
"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/alert-notification-filters/audit/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"uuid": "string",
"properties": {
"name": {
"type": "string",
"enum": [
"string"
]
},
"access_point_uuid": {
"type": "string",
"enum": [
"string"
]
},
"user_uuid": {
"type": "string",
"enum": [
"string"
]
}
},
"actions": [
{
"name": "string",
"props": {}
}
],
"active": true
}
DELETE /alert-notification-filters/audit/{uuid}
Раздел: События.
Удаляет фильтр событий аудита по UUID
Назначение | URL запроса |
Удаляет фильтр событий аудита | https://{IP_контроллера}/api/v1/alert-notification-filters/audit/{uuid} |
Параметры запроса:
Наименование, * - обязательный | Описание |
uuid* string($uuid) (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified user defined notification does not exist) - запрос не выполнен, указанный тип событий не найден
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Delete access event filter",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "access event filter successfully deleted",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified access event filter does not exist",
"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 DELETE "https://{IP_контроллера}/api/v1/alert-notification-filters/audit/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /alert-notification-filters/notification/{uuid}
Раздел: События.
Возвращает события оповещения с настроенными уведомлениями по UUID
Назначение | URL запроса |
Получает список пользовательских событий оповещения по | https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications/{uuid} |
Параметры запроса:
Наименование | Описание |
uuid* string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | Уникальный идентификатор | |
properties* | string | name, access_point_uuid, type, enum | Свойства события |
actions | string | Действия | |
active | boolean | Состояние события |
{
"uuid": "string",
"properties": {
"name": {
"type": "string",
"enum": [
"string"
]
},
"access_point_uuid": {
"type": "string",
"enum": [
"string"
]
}
},
"actions": [
{
"name": "string",
"props": {}
}
],
"active": true
}
Code 400 (Invalid UUID) - запрос не выполнен, указан некорректный uuid в запросе
Code 404 (Specified event was not found) - запрос не выполнен, указанное событие не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns notification event filter with specified UUID",
"parameters": [
{
"name": "uuid",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Notification event filter uuid"
}
],
"responses": {
"200": {
"description": "Successfully got event with specified UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"properties"
],
"properties": {
"uuid": {
"type": "string",
"description": "Уникальный идентификатор"
},
"properties": {
"type": "object",
"properties": {
"name": {
"type": "object",
"required": [
"type",
"enum"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"access_point_uuid": {
"type": "object",
"required": [
"type",
"enum"
],
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"actions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"props": {
"type": "object"
}
}
}
},
"active": {
"type": "boolean"
}
},
"additionalProperties": false
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified event was not found",
"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/alert-notification-filters/notification/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"uuid": "string",
"properties": {
"name": {
"type": "string",
"enum": [
"string"
]
},
"access_point_uuid": {
"type": "string",
"enum": [
"string"
]
}
},
"actions": [
{
"name": "string",
"props": {}
}
],
"active": true
}
DELETE /alert-notification-filters/notification/{uuid}
Раздел: События.
Удаляет фильтр уведомлений по UUID
Назначение | URL запроса |
Удаляет фильтр уведомлений | https://{IP_контроллера}/api/v1/alert-notification-filters/notification/{uuid} |
Параметры запроса:
Наименование, * - обязательный | Описание |
uuid * string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified user defined notification does not exist) - запрос не выполнен, указанное уведомление не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Delete notification event filter",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "notification event filter successfully deleted",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified notification event filter does not exist",
"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 DELETE "https://{IP_контроллера}/api/v1/alert-notification-filters/notification/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /audit_events
Раздел: События.
Возвращает постраничный список событий аудита
Назначение | URL запроса |
Возвращает постраничный список событий аудита | https://{IP_контроллера}/api/v1/audit_events?from=1643057999999&page_size=10 |
Параметры запроса:
Название, * - обязательный | Тип | Формат | Назначение |
from* | integer | $int64 | UTC UNIX временная метка в миллисекундах, с которой учитывать события (включительно) |
to integer | integer | $int64 | UTC UNIX временная метка в миллисекундах, до которой учитывать события (включительно) |
page_size* | integer | Количество событий (строк) на страницу | |
cursor | string | С какой строки начать поиск |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
timestamp | integer | $int64 | UNIX временная метка события в миллисекундах |
type* | string | minLength: 1
| Тип события аудита |
reason* | string | minLength: 1
| Причина события аудита |
object_type* | string | minLength: 1 | Тип объекта события аудита |
object_id* | string | minLength: 1 | ID объекта аудита |
object_name* | string | minLength: 1 | Описание события |
author_id* | string | minLength: 1 | Автор события |
author_name* | string | minLength: 1 | Автор события |
cursor* | string | Номер строки следующего поиска |
{
"events": [
{
"uuid": "string",
"timestamp": 0,
"type": "DATA",
"reason": "CREATE",
"object_type": "string",
"object_id": "string",
"object_name": "string",
"author_id": "string",
"author_name": "string"
}
],
"cursor": "string"
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Return audit events in specified interval sorted by timestamp in reverse order",
"parameters": [
{
"in": "query",
"name": "from",
"required": true,
"description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"in": "query",
"name": "to",
"required": false,
"description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"in": "query",
"name": "page_size",
"required": true,
"description": "Returned events max number",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"in": "query",
"name": "cursor",
"required": false,
"description": "Search results cursor",
"schema": {
"type": "string",
"nullable": true,
"default": ""
}
}
],
"responses": {
"200": {
"description": "Successfully returned events happened in specified time period",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"events",
"cursor"
],
"properties": {
"events": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"type",
"reason",
"object_type",
"object_id",
"object_name",
"author_id",
"author_name"
],
"properties": {
"uuid": {
"type": "string",
"description": "Audit event id",
"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}$"
},
"timestamp": {
"type": "integer",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"type": "string",
"enum": [
"DATA",
"ACCESS",
"EXECUTE_TOKEN",
"EXTERNAL"
],
"description": "Тип события (полный список типов и причин доступен по get запросу /audit_events/types):\n *`DATA` - Тип для работы с данными\n *`ACCESS` - Права доступа объекта\n *`EXECUTE_TOKEN` - Тип для входа в систему\n"
},
"reason": {
"type": "string",
"enum": [
"CREATE",
"MODIFY_DATA",
"MODIFY_TOKEN",
"DELETE",
"EXECUTE_TOKEN_ACCEPTED",
"EXECUTE_TOKEN_REJECTED",
"INTERNAL_MODIFY_DATA",
"INTERNAL_MODIFY_TOKEN",
"GUARDING_REJECTED",
"CLEAR_CONFIG",
"EXTERNAL_ACCESS"
],
"description": "Причина события (полный список типов и причин доступен по get запросу /audit_events/types):\n *`CREATE` - Объект создан\n *`DELETE` - Объект удалён\n *`MODIFY_DATA` - Данные объекта изменены пользователем\n *`MODIFY_TOKEN` - Права доступа объекта изменены пользователем\n *`INTERNAL_MODIFY_DATA` - Данные объекта изменены системой\n *`INTERNAL_MODIFY_TOKEN` - Права доступа объекта изменены системой\n *`EXECUTE_TOKEN_ACCEPTED` - Пользователь успешно вошёл в систему\n *`EXECUTE_TOKEN_REJECTED` - Неудачная попытка входа в систему\n"
},
"object_type": {
"type": "string",
"minLength": 1
},
"object_id": {
"type": "string",
"minLength": 1,
"description": "Object on which event was triggered"
},
"object_name": {
"type": "string",
"minLength": 1
},
"author_id": {
"type": "string",
"minLength": 1,
"description": "Author of event"
},
"author_name": {
"type": "string",
"minLength": 1
}
}
}
},
"cursor": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "Bad search parameters",
"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/audit_events?from=1&page_size=1" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"events": [
{
"uuid": "string",
"timestamp": 1,
"type": "DATA",
"reason": "CREATE",
"object_type": "string",
"object_id": "string",
"object_name": "string",
"author_id": "string",
"author_name": "string"
}
],
"cursor": "string"
}
GET /audit_events/count
Раздел: События.
Возвращает количество событий аудита в системе за определенный период времени
Назначение | URL запроса |
Возвращает количество событий аудита в системе за определенный период времени | https://{IP_контроллера}/api/v1/audit_events/count?from=1643057999999 |
Параметры запроса:
Наименование | Описание |
from * integer($int64) (query) to integer ($int64) (query) user_type string (query) | UTC UNIX временная метка в миллисекундах, с которой учитывать события (включительно) UTC UNIX временная метка в миллисекундах, до которой учитывать события (включительно) Тип пользователя |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"count": 0
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Return events count in specified interval",
"parameters": [
{
"in": "query",
"name": "from",
"required": true,
"description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"in": "query",
"name": "to",
"required": false,
"description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "user_type",
"in": "query",
"required": false,
"description": "Type of user visitor or staff",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successfully returned events count in specified time period",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"count"
],
"properties": {
"count": {
"type": "integer",
"minimum": 0
}
}
}
}
}
},
"400": {
"description": "Bad search parameters",
"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/audit_events/count?from=1" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"count": 1
}
GET /audit_events/types
Раздел: События.
Возвращает список доступных типов событий аудита
Назначение | URL запроса |
Возвращает список доступных типов событий аудита | https://{IP_контроллера}/api/v1/audit_events/types |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
type* | string | Тип события | |
reason* | string | Причина события | |
description* | string | Описание события |
[
{
"type": "string",
"reason": "string",
"description": "string"
}
]
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Get available events types list",
"responses": {
"200": {
"description": "Successfully got events types",
"content": {
"application/json": {
"schema": {
"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/audit_events/types" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"type": "string",
"reason": "string",
"description": "string"
}
]
POST /audit_events/user_defined
Раздел: События.
Добавляет пользовательское событие с типом "Аудит"
Назначение | URL запроса |
Добавляет пользовательское событие с типом “Аудит” | https://{IP_контроллера}/api/v1/audit_events/user_defined |
Параметры запроса:
Параметры отсутствуют
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
timestamp* | number | $int64 | UNIX временная метка события в миллисекундах |
type* | string | minLength: 1
| Тип события аудита |
reason* | string | minLength: 1
| Причина события аудита |
object_type* | string | minLength: 1 | Тип объекта события аудита |
object_id* | string | minLength: 1 | ID объекта аудита |
object_name* | string | minLength: 1 | Описание события |
author_id* | string | minLength: 1 | Автор события |
author_name* | string | minLength: 1 | Автор события |
Пример:
URL запроса: POST
https://{IP_контроллера}/api/v1/api/v1/audit_events/user_defined
Body
{
"uuid": "string",
"timestamp": 0,
"type": "DATA",
"reason": "CREATE",
"object_type": "string",
"object_id": "string",
"object_name": "string",
"author_id": "string",
"author_name": "string"
}
Варианты ответа:
Code 201 (Successfully) - удачное выполнение запроса
{
"success": true,
"message": "string",
"uuid": "string"
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 409 (Audit with specified UUID already exists) - запрос не выполнен, указанное событие аудита не найдено
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Add new user defined audit",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"timestamp",
"type",
"reason",
"object_type",
"object_id",
"object_name",
"author_id",
"author_name"
],
"properties": {
"uuid": {
"type": "string",
"description": "Audit event id",
"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}$"
},
"timestamp": {
"type": "integer",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"type": "string",
"enum": [
"DATA",
"ACCESS",
"EXECUTE_TOKEN",
"EXTERNAL"
],
"description": "Тип события (полный список типов и причин доступен по get запросу /audit_events/types):\n *`DATA` - Тип для работы с данными\n *`ACCESS` - Права доступа объекта\n *`EXECUTE_TOKEN` - Тип для входа в систему\n"
},
"reason": {
"type": "string",
"enum": [
"CREATE",
"MODIFY_DATA",
"MODIFY_TOKEN",
"DELETE",
"EXECUTE_TOKEN_ACCEPTED",
"EXECUTE_TOKEN_REJECTED",
"INTERNAL_MODIFY_DATA",
"INTERNAL_MODIFY_TOKEN",
"GUARDING_REJECTED",
"CLEAR_CONFIG",
"EXTERNAL_ACCESS"
],
"description": "Причина события (полный список типов и причин доступен по get запросу /audit_events/types):\n *`CREATE` - Объект создан\n *`DELETE` - Объект удалён\n *`MODIFY_DATA` - Данные объекта изменены пользователем\n *`MODIFY_TOKEN` - Права доступа объекта изменены пользователем\n *`INTERNAL_MODIFY_DATA` - Данные объекта изменены системой\n *`INTERNAL_MODIFY_TOKEN` - Права доступа объекта изменены системой\n *`EXECUTE_TOKEN_ACCEPTED` - Пользователь успешно вошёл в систему\n *`EXECUTE_TOKEN_REJECTED` - Неудачная попытка входа в систему\n"
},
"object_type": {
"type": "string",
"minLength": 1
},
"object_id": {
"type": "string",
"minLength": 1,
"description": "Object on which event was triggered"
},
"object_name": {
"type": "string",
"minLength": 1
},
"author_id": {
"type": "string",
"minLength": 1,
"description": "Author of event"
},
"author_name": {
"type": "string",
"minLength": 1
}
}
}
}
},
"required": true
},
"responses": {
"201": {
"description": "Successfully created new user defined audit",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
},
"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}$"
}
}
}
}
}
},
"400": {
"description": "Bad parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"409": {
"description": "audit with specified UUID already exists",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X POST "https://{IP_контроллера}/api/v1/audit_events/user_defined" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"timestamp": 1,
"type": "DATA",
"reason": "CREATE",
"object_type": "string",
"object_id": "string",
"object_name": "string",
"author_id": "string",
"author_name": "string"
}'
Пример тела запроса
{
"uuid": "string",
"timestamp": 1,
"type": "DATA",
"reason": "CREATE",
"object_type": "string",
"object_id": "string",
"object_name": "string",
"author_id": "string",
"author_name": "string"
}
Пример ответа
{
"success": true,
"message": "string",
"uuid": "string"
}
PUT /audit_events/user_defined/{uuid}
Раздел: События.
Редактирует существующее пользовательское событие аудита
Назначение | URL запроса |
Редактирует существующее пользовательское событие аудита | https://{IP_контроллера}/api/v1/audit_events/user_defined/{uuid} |
Параметры запроса:
Название | Тип | Описание | |
uuid * | string (path) | uuid события Аудита | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid | 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}$ | UUID события |
timestamp* | integer | ($int64) | UNIX временная метка события в миллисекундах |
type* | string | [ DATA, ACCESS, EXECUTE_TOKEN, EXTERNAL ] | Тип события (полный список типов и причин доступен по get запросу /audit_events/types): Варианты: |
reason* | string | [ CREATE, MODIFY_DATA, MODIFY_TOKEN, DELETE, EXECUTE_TOKEN_ACCEPTED, EXECUTE_TOKEN_REJECTED, INTERNAL_MODIFY_DATA, INTERNAL_MODIFY_TOKEN, GUARDING_REJECTED, CLEAR_CONFIG, EXTERNAL_ACCESS ] | Причина события (полный список типов и причин доступен по get запросу /audit_events/types). Варианты: |
object_type* | string | minLength: 1 | Тип объекта с которым произвели действия |
object_id* | string | minLength: 1 | uuid объекта с которым произвели действия |
object_name* | string | minLength: 1 | Имя объекта с которым произошли действия (например имя сотрудника, которого отредактировали, или имя профиля доступа, который был изменен) |
author_id* | string | minLength: 1 | login оператора |
author_name* | string | minLength: 1 | Имя сотрудника или login оператора |
Пример:
URL запроса: PUT
https://{IP_контроллера}/api/v1/audit_events/user_defined/{uuid}
Body
{
"uuid": "string",
"timestamp": 0,
"type": "DATA",
"reason": "CREATE",
"object_type": "string",
"object_id": "string",
"object_name": "string",
"author_id": "string",
"author_name": "string"
}
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified user defined audit does not exist) - запрос не выполнен, указанная событие не существует
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Update specified user defined audit data",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
"example": "123e4567-e89b-12d3-a456-426614174000"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"timestamp",
"type",
"reason",
"object_type",
"object_id",
"object_name",
"author_id",
"author_name"
],
"properties": {
"uuid": {
"type": "string",
"description": "Audit event id",
"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}$"
},
"timestamp": {
"type": "integer",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"type": "string",
"enum": [
"DATA",
"ACCESS",
"EXECUTE_TOKEN",
"EXTERNAL"
],
"description": "Тип события (полный список типов и причин доступен по get запросу /audit_events/types):\n *`DATA` - Тип для работы с данными\n *`ACCESS` - Права доступа объекта\n *`EXECUTE_TOKEN` - Тип для входа в систему\n"
},
"reason": {
"type": "string",
"enum": [
"CREATE",
"MODIFY_DATA",
"MODIFY_TOKEN",
"DELETE",
"EXECUTE_TOKEN_ACCEPTED",
"EXECUTE_TOKEN_REJECTED",
"INTERNAL_MODIFY_DATA",
"INTERNAL_MODIFY_TOKEN",
"GUARDING_REJECTED",
"CLEAR_CONFIG",
"EXTERNAL_ACCESS"
],
"description": "Причина события (полный список типов и причин доступен по get запросу /audit_events/types):\n *`CREATE` - Объект создан\n *`DELETE` - Объект удалён\n *`MODIFY_DATA` - Данные объекта изменены пользователем\n *`MODIFY_TOKEN` - Права доступа объекта изменены пользователем\n *`INTERNAL_MODIFY_DATA` - Данные объекта изменены системой\n *`INTERNAL_MODIFY_TOKEN` - Права доступа объекта изменены системой\n *`EXECUTE_TOKEN_ACCEPTED` - Пользователь успешно вошёл в систему\n *`EXECUTE_TOKEN_REJECTED` - Неудачная попытка входа в систему\n"
},
"object_type": {
"type": "string",
"minLength": 1
},
"object_id": {
"type": "string",
"minLength": 1,
"description": "Object on which event was triggered"
},
"object_name": {
"type": "string",
"minLength": 1
},
"author_id": {
"type": "string",
"minLength": 1,
"description": "Author of event"
},
"author_name": {
"type": "string",
"minLength": 1
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully update user defined audit data",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified user defined audit does not exist",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X PUT "https://{IP_контроллера}/api/v1/audit_events/user_defined/{uuid}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"timestamp": 1,
"type": "DATA",
"reason": "CREATE",
"object_type": "string",
"object_id": "string",
"object_name": "string",
"author_id": "string",
"author_name": "string"
}'
Пример тела запроса
{
"uuid": "string",
"timestamp": 1,
"type": "DATA",
"reason": "CREATE",
"object_type": "string",
"object_id": "string",
"object_name": "string",
"author_id": "string",
"author_name": "string"
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
DELETE /audit_events/user_defined/{uuid}
Раздел: События.
Удаляет указанный пользовательский аудит по UUID
Назначение | URL запроса |
Удаляет указанный пользовательский аудит | https://{IP_контроллера}/api/v1/audit_events/user_defined/{uuid} |
Параметры запроса:
Наименование, * - обязательный | Описание |
uuid * string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified user defined notification does not exist) - запрос не выполнен, указанное событие не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Delete specified user defined audit",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
],
"responses": {
"200": {
"description": "Successfully deleted user defined audit",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified user defined audit does not exist",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X DELETE "https://{IP_контроллера}/api/v1/audit_events/user_defined/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /audit_events/{uuid}
Раздел: События.
Возвращает данные конкретного события аудита по uuid
Назначение | URL запроса |
Возвращает данные конкретного события аудита по uuid | https://{IP_контроллера}/api/v1/audit_events/b0de19a1-fcd2-42fd-9b13-500c21d8b057 |
Параметры запроса:
Наименование | Описание |
uuid* string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
user_uuid* | string | pattern:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | уникальный идентификатор сотрудника, которому предоставляется доступ |
interval_from* | string | minLength: 4, maxLength: 5 | Время начала действия доступа в формате: "ч:мин" - “9:30” |
timestamp | number | $int64 | UNIX временная метка события в миллисекундах |
type* | string | minLength: 1
| Тип события аудита |
reason* | string | minLength: 1
| Причина события аудита |
object_type* | string | minLength: 1 | Тип объекта события аудита |
object_id* | string | minLength: 1 | ID объекта аудита |
object_name* | string | minLength: 1 | Описание события |
author_id* | string | minLength: 1 | Автор события |
author_name* | string | minLength: 1 | Автор события |
{
"uuid": "string",
"timestamp": 0,
"type": "DATA",
"reason": "CREATE",
"object_type": "string",
"object_id": "string",
"object_name": "string",
"author_id": "string",
"author_name": "string"
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified event was not found) - запрос не выполнен, указанное событие не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns audit event with specified UUID",
"parameters": [
{
"name": "uuid",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Audit event uuid"
}
],
"responses": {
"200": {
"description": "Successfully got event with specified UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"type",
"reason",
"object_type",
"object_id",
"object_name",
"author_id",
"author_name"
],
"properties": {
"uuid": {
"type": "string",
"description": "Audit event id",
"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}$"
},
"timestamp": {
"type": "integer",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"type": "string",
"enum": [
"DATA",
"ACCESS",
"EXECUTE_TOKEN",
"EXTERNAL"
],
"description": "Тип события (полный список типов и причин доступен по get запросу /audit_events/types):\n *`DATA` - Тип для работы с данными\n *`ACCESS` - Права доступа объекта\n *`EXECUTE_TOKEN` - Тип для входа в систему\n"
},
"reason": {
"type": "string",
"enum": [
"CREATE",
"MODIFY_DATA",
"MODIFY_TOKEN",
"DELETE",
"EXECUTE_TOKEN_ACCEPTED",
"EXECUTE_TOKEN_REJECTED",
"INTERNAL_MODIFY_DATA",
"INTERNAL_MODIFY_TOKEN",
"GUARDING_REJECTED",
"CLEAR_CONFIG",
"EXTERNAL_ACCESS"
],
"description": "Причина события (полный список типов и причин доступен по get запросу /audit_events/types):\n *`CREATE` - Объект создан\n *`DELETE` - Объект удалён\n *`MODIFY_DATA` - Данные объекта изменены пользователем\n *`MODIFY_TOKEN` - Права доступа объекта изменены пользователем\n *`INTERNAL_MODIFY_DATA` - Данные объекта изменены системой\n *`INTERNAL_MODIFY_TOKEN` - Права доступа объекта изменены системой\n *`EXECUTE_TOKEN_ACCEPTED` - Пользователь успешно вошёл в систему\n *`EXECUTE_TOKEN_REJECTED` - Неудачная попытка входа в систему\n"
},
"object_type": {
"type": "string",
"minLength": 1
},
"object_id": {
"type": "string",
"minLength": 1,
"description": "Object on which event was triggered"
},
"object_name": {
"type": "string",
"minLength": 1
},
"author_id": {
"type": "string",
"minLength": 1,
"description": "Author of event"
},
"author_name": {
"type": "string",
"minLength": 1
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified event was not found",
"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/audit_events/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"uuid": "string",
"timestamp": 1,
"type": "DATA",
"reason": "CREATE",
"object_type": "string",
"object_id": "string",
"object_name": "string",
"author_id": "string",
"author_name": "string"
}
GET /notification_events
Раздел: События.
Возвращает постраничный список событий оповещений
Назначение | URL запроса |
Возвращает постраничный список событий оповещений | https://{IP_контроллера}/api/v1/notification_events?from=1643057999999&page_size=10 |
Параметры запроса:
Наименование | Описание |
from* integer($int64) (query) to integer ($int64) (query) page_size* integer (query) cursor string (query) | UTC UNIX временная метка в миллисекундах, с которой учитывать события (включительно) UTC UNIX временная метка в миллисекундах, до которой учитывать события (включительно) Количество событий (строк) на страницу С какой строки начать поиск |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
timestamp* | number | $int64 | UNIX временная метка события в миллисекундах |
type* | string | [ INFO, WARN, ALERT ] | Тип оповещения |
reason* | string | Описание события | |
controller* | string | Серийный номер контроллера события | |
source_type* | string | [HARDWARE, NETWORK, SERVICE] | Тип источника события |
source* | string | UUID источника | |
error_code | integer | Для событий с типом ALERT и WARN сообщает об ошибке. Для событий с типом INFO сообщает какая ошибка была исправлена | Код ошибки |
cursor* | string | Номер строки следующего поиска |
{
"events": [
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 0
}
],
"cursor": "string"
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns notification events by specified query parameters",
"parameters": [
{
"in": "query",
"name": "from",
"required": true,
"description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"in": "query",
"name": "to",
"required": false,
"description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"in": "query",
"name": "page_size",
"required": true,
"description": "Returned events max number",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"in": "query",
"name": "cursor",
"required": false,
"description": "Search results cursor",
"schema": {
"type": "string",
"nullable": true,
"default": ""
}
}
],
"responses": {
"200": {
"description": "Successfully returned events happened in specified time period",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"events",
"cursor"
],
"properties": {
"events": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"timestamp",
"type",
"reason",
"controller",
"source_type",
"source"
],
"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}$",
"description": "Event UUID"
},
"name": {
"type": "string",
"example": "ACCESS_MODE_CHANGED",
"description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
},
"timestamp": {
"type": "number",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n *`INFO` - Информационное сообщение\n *`WARN` - Предупреждение\n *`ALERT` - Тревога\n",
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT",
"EVENT"
]
},
"reason": {
"description": "Event description",
"type": "string"
},
"controller": {
"description": "Event producer",
"type": "string"
},
"source_type": {
"description": "Event source type",
"type": "string",
"enum": [
"HARDWARE",
"NETWORK",
"SERVICE",
"SECURITY",
"STAFF"
]
},
"source": {
"type": "string",
"description": "Source id"
},
"error_code": {
"type": "integer",
"description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
}
}
}
},
"cursor": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "Bad search parameters",
"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_events?from=1&page_size=1" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"events": [
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 1.0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 1
}
],
"cursor": "string"
}
GET /notification_events/count
Раздел: События.
Возвращает количество событий оповещения в системе за определенный период
Назначение | URL запроса |
Возвращает количество событий оповещения в системе за определенный период | https://{IP_контроллера}/api/v1/notification_events/count?from=1643057999999 |
Параметры запроса:
Наименование | Описание |
from* integer($int64) (query) to integer ($int64) (query) user_type string (query) | UTC UNIX временная метка в миллисекундах, с которой учитывать события (включительно) UTC UNIX временная метка в миллисекундах, до которой учитывать события (включительно) Тип пользователя |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"count": 0
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Return events count in specified interval",
"parameters": [
{
"in": "query",
"name": "from",
"required": true,
"description": "UTC UNIX timestamp in milliseconds to get events happened since (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"in": "query",
"name": "to",
"required": false,
"description": "UTC UNIX timestamp in milliseconds to get events happened before (inclusive)",
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "user_type",
"in": "query",
"required": false,
"description": "Type of user visitor or staff",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successfully returned events count in specified time period",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"count"
],
"properties": {
"count": {
"type": "integer",
"minimum": 0
}
}
}
}
}
},
"400": {
"description": "Bad search parameters",
"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_events/count?from=1" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"count": 1
}
GET /notification_events/error_codes
Раздел: События.
Возвращает список кодов ошибок событий оповещения с описанием
Назначение | URL запроса |
Возвращает список кодов ошибок событий оповещения с описанием | https://{IP_контроллера}/api/v1/notification_events/error_codes |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
[
{
"code": 0,
"source_type": "HARDWARE",
"description": "string"
}
]
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Get notification events error codes descriptions",
"responses": {
"200": {
"description": "Successfully received error codes",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"description"
],
"properties": {
"code": {
"type": "integer",
"description": "Error code"
},
"source_type": {
"type": "string",
"enum": [
"HARDWARE",
"SERVICE",
"NETWORK"
],
"description": "Correspoinding notification event source type"
},
"description": {
"type": "string",
"description": "Error code description"
}
}
}
}
}
}
},
"500": {
"description": "Server error",
"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_events/error_codes" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"code": 1,
"source_type": "HARDWARE",
"description": "string"
}
]
GET /notification_events/types
Раздел: События.
Возвращает список доступных типов событий оповещений с описанием
Назначение | URL запроса |
Возвращает список доступных типов событий оповещений с описанием | https://{IP_контроллера}/api/v1/notification_events/types |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
type* | string | Тип события | |
reason* | string | Причина события | |
description* | string | Описание события |
[
{
"type": "string",
"reason": "string",
"description": "string"
}
]
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Get available events types list",
"responses": {
"200": {
"description": "Successfully got events types",
"content": {
"application/json": {
"schema": {
"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_events/types" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"type": "string",
"reason": "string",
"description": "string"
}
]
POST /notification_events/user_defined
Раздел: События.
Добавляет пользовательское событие с типом «Оповещения»
Назначение | URL запроса |
Добавляет пользовательское событие с типом «Оповещения» (notification_events) | https://{IP_контроллера}/api/v1/notification_events/user_defined/ |
Параметры запроса:
Название | Тип | Описание | |
object (body)* | query/body/path | Тело запроса | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid | 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 | string | ||
timestamp | number | $int64 | |
type* | string | [ INFO, WARN, ALERT, EVENT ] | Тип события (полный список типов и причин доступен по get запросу /notification_events/types): |
reason* | string | Описание события | |
controller* | string | С/н контроллера источника события | |
source_type | string | [ HARDWARE, NETWORK, SERVICE, SECURITY, STAFF ] | Тип источника события |
source | string | ID причины события | |
error_code | integer | Код ошибки. | |
Пример:
URL запроса: POST
https://{IP_контроллера}/api/v1/notification_events/user_defined
Body
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 0
}
Варианты ответа:
Code 201 (Successfully) - удачное выполнение запроса
Пример с исправленным синтаксисом JSON
Добавлена запятая после message.
{
"success": true,
"message": "string",
"uuid": "string"
}
Исходный пример Teamly
Пример из Teamly сохранён дословно, но не является корректным JSON.
{
"success": true,
"message": "string"
"uuid": "string"
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 409 (User with specified uuid already exists) - запрос не выполнен, пользователь с таким uuid уже добавлен
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Add new user defined notification",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"type",
"controller",
"reason"
],
"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}$",
"description": "Event UUID"
},
"name": {
"type": "string",
"example": "ACCESS_MODE_CHANGED",
"description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
},
"timestamp": {
"type": "number",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n *`INFO` - Информационное сообщение\n *`WARN` - Предупреждение\n *`ALERT` - Тревога\n",
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT",
"EVENT"
]
},
"reason": {
"description": "Event description",
"type": "string"
},
"controller": {
"description": "Event producer",
"type": "string"
},
"source_type": {
"description": "Event source type",
"type": "string",
"enum": [
"HARDWARE",
"NETWORK",
"SERVICE",
"SECURITY",
"STAFF"
]
},
"source": {
"type": "string",
"description": "Source id"
},
"error_code": {
"type": "integer",
"description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
}
}
}
}
},
"required": true
},
"responses": {
"201": {
"description": "Successfully created new user defined notification",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
},
"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}$"
}
}
}
}
}
},
"400": {
"description": "Bad parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"409": {
"description": "notification with specified UUID already exists",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X POST "https://{IP_контроллера}/api/v1/notification_events/user_defined" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 1.0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 1
}'
Пример тела запроса
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 1.0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 1
}
Пример ответа
{
"success": true,
"message": "string",
"uuid": "string"
}
PUT /notification_events/user_defined/{uuid}
Раздел: События.
Редактирует существующее пользовательское событие оповещений
Назначение | URL запроса |
Редактирует существующее пользовательское событие оповещений | https://{IP_контроллера}/api/v1/notification_events/user_defined/{uuid} |
Параметры запроса:
Название | Тип | Описание | |
uuid* | string (path) | uuid события доступа | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid | 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}$ | uuid события |
name | string | example: ACCESS_MODE_CHANGED | Имя события (полный список имен доступен по get запросу /notification_events/types) |
timestamp | number | ($int64) | UNIX временная метка события в миллисекундах |
type* | string | [ INFO, WARN, ALERT, EVENT ] | полный список типов и причин доступен по get запросу /notification_events/types Варианты: |
reason* | string | Причина события | |
controller* | string | Серийный номер контроллера источника события | |
source_type | string | [ HARDWARE, NETWORK, SERVICE, SECURITY, STAFF ] | Тип источника события Варианты: |
source | string | ID причины события | |
error_code | integer | Код ошибки. | |
Пример:
URL запроса: PUT
https://{IP_контроллера}/api/v1/notification_events/user_defined/{uuid}
Body
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 0
}
Варианты ответа:
Code 201 (Successfully) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified user defined notification does not exist) Указанное пользователем уведомление не существует
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Update specified user defined notification data",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
"example": "123e4567-e89b-12d3-a456-426614174000"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"type",
"controller",
"reason"
],
"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}$",
"description": "Event UUID"
},
"name": {
"type": "string",
"example": "ACCESS_MODE_CHANGED",
"description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
},
"timestamp": {
"type": "number",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n *`INFO` - Информационное сообщение\n *`WARN` - Предупреждение\n *`ALERT` - Тревога\n",
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT",
"EVENT"
]
},
"reason": {
"description": "Event description",
"type": "string"
},
"controller": {
"description": "Event producer",
"type": "string"
},
"source_type": {
"description": "Event source type",
"type": "string",
"enum": [
"HARDWARE",
"NETWORK",
"SERVICE",
"SECURITY",
"STAFF"
]
},
"source": {
"type": "string",
"description": "Source id"
},
"error_code": {
"type": "integer",
"description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully update user defined notification data",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified user defined notification does not exist",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X PUT "https://{IP_контроллера}/api/v1/notification_events/user_defined/{uuid}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 1.0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 1
}'
Пример тела запроса
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 1.0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 1
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
DELETE /notification_events/user_defined/{uuid}
Раздел: События.
Удаляет указанное пользовательское уведомление по UUID
Назначение | URL запроса |
Удаляет указанное пользовательское уведомление по UUID | https://{IP_контроллера}/api/v1/notification_events/user_defined/{uuid} |
Параметры запроса:
Наименование, * - обязательный | Описание |
uuid * string (path) | UUID уведомления |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified user defined notification does not exist) - запрос не выполнен, указанное уведомление не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Delete specified user defined notification",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
],
"responses": {
"200": {
"description": "Successfully deleted user defined notification",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified user defined notification does not exist",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X DELETE "https://{IP_контроллера}/api/v1/notification_events/user_defined/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /notification_events/user_defined_notifications
Раздел: События.
Получает список пользовательских событий оповещения
Назначение | URL запроса |
Получает список пользовательских событий оповещения | https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications/ |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
sensor_type* | string | [NC, NO] | Нормально замкнутый или нормально разомкнутый тип датчика |
notification_type* | string | [INFO, WARN, ALERT] | Тип полученного оповещения |
state_description* | string | minLength: 1 | Описание оповещения |
guarded_access_point | string | maxLength: 36 | Генерация оповещения в случае, если указанная точка прохода (UUID) стоит на охране |
error_code | integer | minimum: 4001 maximum: 4999 | Код события оповещения |
signal_input_devices* | string | [device_uuid] | Список датчиков генерирующих событие оповещения |
{
"uuid": "string",
"sensor_type": "NC",
"notification_type": "INFO",
"state_description": "string",
"guarded_access_point": "string",
"error_code": 4999,
"signal_input_devices": [
"stringstringstringstringstringstringstr"
]
}
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Get all user defined notifications",
"responses": {
"200": {
"description": "Successfully got all user defined notifications",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"sensor_type",
"notification_type",
"state_description",
"signal_input_devices"
],
"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}$"
},
"sensor_type": {
"type": "string",
"enum": [
"NC",
"NO"
],
"description": "Normally closed or normally opened sensor"
},
"notification_type": {
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT"
],
"description": "Indicates which notification event type will be generated on sensor response"
},
"state_description": {
"type": "string",
"minLength": 1,
"description": "State description on sensor triggered"
},
"guarded_access_point": {
"type": "string",
"maxLength": 36,
"description": "Generate alarm only if specified access point (UUID) guarded"
},
"error_code": {
"type": "integer",
"minimum": 4001,
"maximum": 4999,
"description": "Notification error code"
},
"signal_input_devices": {
"type": "array",
"items": {
"type": "string",
"minLength": 39,
"description": "Subdevice of type \"input\" that will trigger events generation in format: <device_uuid>:<subdevice_address>"
}
}
}
}
}
}
},
"500": {
"description": "Server error",
"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_events/user_defined_notifications" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"uuid": "string",
"sensor_type": "NC",
"notification_type": "INFO",
"state_description": "string",
"guarded_access_point": "string",
"error_code": 4001,
"signal_input_devices": [
"stringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
]
}
POST /notification_events/user_defined_notifications
Раздел: События.
Добавляет пользовательскую настройку генерации событий оповещения и тревоги
Назначение | URL запроса |
Добавляет пользовательскую настройку генерации событий оповещения и тревоги | https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications/ |
Параметры запроса:
Параметры отсутствуют
BODY | |||
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
sensor_type* | string | [NC, NO] | Нормально замкнутый или нормально разомкнутый тип датчика |
notification_type* | string | [INFO, WARN, ALERT] | Тип полученного оповещения |
state_description* | string | minLength: 1 | Описание оповещения |
guarded_access_point | string | maxLength: 36 | Генерация оповещения в случае, если указанная точка прохода (UUID) стоит на охране |
error_code | integer | minimum: 4001 maximum: 4999 | Код события оповещения |
signal_input_devices* | string | [device_uuid] | Список датчиков генерирующих событие оповещения |
Пример:
URL запроса: POST
https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications/
Body
{
"uuid": "aa1c4f71-98d9-11ec-b21e-b5be8bb5cbdd",
"guarded_access_point": "a3951730-7477-11ec-aafa-0997381d51e8",
"state_description": "Открыта дверь на охране",
"notification_type": "WARN",
"sensor_type": "NO",
"error_code": 4001,
"signal_input_devices": [
"10a70450-5ce5-11ec-a195-fb1e5495dfa6:/input/2"
]
}
Варианты ответа:
Code 201 (Successfully) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 409 (Notification with specified UUID already exists) - запрос не выполнен, уведомление с таким uuid уже существует
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Add new user defined notification",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"sensor_type",
"notification_type",
"state_description",
"signal_input_devices"
],
"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}$"
},
"sensor_type": {
"type": "string",
"enum": [
"NC",
"NO"
],
"description": "Normally closed or normally opened sensor"
},
"notification_type": {
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT"
],
"description": "Indicates which notification event type will be generated on sensor response"
},
"state_description": {
"type": "string",
"minLength": 1,
"description": "State description on sensor triggered"
},
"guarded_access_point": {
"type": "string",
"maxLength": 36,
"description": "Generate alarm only if specified access point (UUID) guarded"
},
"error_code": {
"type": "integer",
"minimum": 4001,
"maximum": 4999,
"description": "Notification error code"
},
"signal_input_devices": {
"type": "array",
"items": {
"type": "string",
"minLength": 39,
"description": "Subdevice of type \"input\" that will trigger events generation in format: <device_uuid>:<subdevice_address>"
}
}
}
}
}
},
"required": true
},
"responses": {
"201": {
"description": "Successfully created new user defined notification",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"409": {
"description": "Notification with specified UUID already exists",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X POST "https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"sensor_type": "NC",
"notification_type": "INFO",
"state_description": "string",
"guarded_access_point": "string",
"error_code": 4001,
"signal_input_devices": [
"stringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
]
}'
Пример тела запроса
{
"uuid": "string",
"sensor_type": "NC",
"notification_type": "INFO",
"state_description": "string",
"guarded_access_point": "string",
"error_code": 4001,
"signal_input_devices": [
"stringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
]
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /notification_events/user_defined_notifications/{uuid}
Раздел: События.
Возвращает данные конкретного пользовательского события оповещения по uuid
Назначение | URL запроса |
Возвращает данные конкретного пользовательского события оповещения по uuid | https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications/b0de19a1-fcd2-42fd-9b13-500c21d8b057 |
Параметры запроса:
Наименование | Описание |
uuid* string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
sensor_type* | string | [NC, NO] | Нормально замкнутый или нормально разомкнутый тип датчика |
notification_type* | string | [INFO, WARN, ALERT] | Тип полученного оповещения |
state_description* | string | minLength: 1 | Описание оповещения |
guarded_access_point | string | maxLength: 36 | Генерация оповещения в случае, если указанная точка прохода (UUID) стоит на охране |
error_code | integer | minimum: 4001 maximum: 4999 | Код события оповещения |
signal_input_devices* | string | [device_uuid] | Список датчиков генерирующих событие оповещения |
{
"uuid": "string",
"sensor_type": "NC",
"notification_type": "INFO",
"state_description": "string",
"guarded_access_point": "string",
"error_code": 4999,
"signal_input_devices": [
"stringstringstringstringstringstringstr"
]
}
Code 400 (Invalid UUID) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified user defined notification does not exist) - запрос не выполнен, указанное событие не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Get specified user defined notification",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
"example": "123e4567-e89b-12d3-a456-426614174000"
}
}
],
"responses": {
"200": {
"description": "Successfully received user defined notification by UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"sensor_type",
"notification_type",
"state_description",
"signal_input_devices"
],
"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}$"
},
"sensor_type": {
"type": "string",
"enum": [
"NC",
"NO"
],
"description": "Normally closed or normally opened sensor"
},
"notification_type": {
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT"
],
"description": "Indicates which notification event type will be generated on sensor response"
},
"state_description": {
"type": "string",
"minLength": 1,
"description": "State description on sensor triggered"
},
"guarded_access_point": {
"type": "string",
"maxLength": 36,
"description": "Generate alarm only if specified access point (UUID) guarded"
},
"error_code": {
"type": "integer",
"minimum": 4001,
"maximum": 4999,
"description": "Notification error code"
},
"signal_input_devices": {
"type": "array",
"items": {
"type": "string",
"minLength": 39,
"description": "Subdevice of type \"input\" that will trigger events generation in format: <device_uuid>:<subdevice_address>"
}
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified user defined notification does not exist",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"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_events/user_defined_notifications/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"uuid": "string",
"sensor_type": "NC",
"notification_type": "INFO",
"state_description": "string",
"guarded_access_point": "string",
"error_code": 4001,
"signal_input_devices": [
"stringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
]
}
PUT /notification_events/user_defined_notifications/{uuid}
Раздел: События.
Редактирует существующую пользовательскую настройку генерации события оповещения и тревоги
Назначение | URL запроса |
Редактирует существующую пользовательскую настройку генерации события оповещения и тревоги | https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications/{uuid} |
Параметры запроса:
Название | Тип | Описание | |
uuid* | string | uuid пользовательского события оповещения | |
notification* | object (body) | тело запроса | |
BODY | |||
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | 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}$ | uuid пользовательского события оповещения |
sensor_type* | string | [NC, NO] | Нормально замкнутый или нормально разомкнутый тип датчика |
notification_type* | string | [INFO, WARN, ALERT] | Тип полученного оповещения |
state_description* | string | minLength: 1 | Описание оповещения |
guarded_access_point | string | minLength: 36 | Генерация оповещения в случае если указанная точка прохода (UUID) стоит на охране |
error_code | integer | minimum: 4001 maximum: 4999 | Код события оповещения |
signal_input_devices* | string | minLength: 39 <device_uuid>:<subdevice_address> | Список датчиков генерирующих событие оповещения |
Пример:
URL запроса: PUT
https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications/13e8afeb-647a-479b-871d-372dc26d7c18
Body:
{
"uuid": "aa1c4f71-98d9-11ec-b21e-b5be8bb5cbdd",
"guarded_access_point": "a3951730-7477-11ec-aafa-0997381d51e8",
"state_description": "Открыта дверь на охране",
"notification_type": "WARN",
"sensor_type": "NO",
"error_code": 4001,
"signal_input_devices": [
"10a70450-5ce5-11ec-a195-fb1e5495dfa6:/input/2"
]
}
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified user defined notification does not exist) - запрос не выполнен, указанная настройка не существует
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Update specified user defined notification data",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
"example": "123e4567-e89b-12d3-a456-426614174000"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"sensor_type",
"notification_type",
"state_description",
"signal_input_devices"
],
"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}$"
},
"sensor_type": {
"type": "string",
"enum": [
"NC",
"NO"
],
"description": "Normally closed or normally opened sensor"
},
"notification_type": {
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT"
],
"description": "Indicates which notification event type will be generated on sensor response"
},
"state_description": {
"type": "string",
"minLength": 1,
"description": "State description on sensor triggered"
},
"guarded_access_point": {
"type": "string",
"maxLength": 36,
"description": "Generate alarm only if specified access point (UUID) guarded"
},
"error_code": {
"type": "integer",
"minimum": 4001,
"maximum": 4999,
"description": "Notification error code"
},
"signal_input_devices": {
"type": "array",
"items": {
"type": "string",
"minLength": 39,
"description": "Subdevice of type \"input\" that will trigger events generation in format: <device_uuid>:<subdevice_address>"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully update user defined notification data",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified user defined notification does not exist",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X PUT "https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications/{uuid}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"sensor_type": "NC",
"notification_type": "INFO",
"state_description": "string",
"guarded_access_point": "string",
"error_code": 4001,
"signal_input_devices": [
"stringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
]
}'
Пример тела запроса
{
"uuid": "string",
"sensor_type": "NC",
"notification_type": "INFO",
"state_description": "string",
"guarded_access_point": "string",
"error_code": 4001,
"signal_input_devices": [
"stringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
]
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
DELETE /notification_events/user_defined_notifications/{uuid}
Раздел: События.
Удаляет пользовательскую настройку генерации события оповещения по UUID
Назначение | URL запроса |
Удаляет пользовательскую настройку генерации события оповещения | https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications/{uuid} |
Параметры запроса:
Наименование | Описание |
uuid * string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified user defined notification does not exist) - запрос не выполнен, указанное событие не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Delete specified user defined notification",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
"example": "123e4567-e89b-12d3-a456-426614174000"
}
}
],
"responses": {
"200": {
"description": "Successfully deleted user defined notification",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified user defined notification does not exist",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X DELETE "https://{IP_контроллера}/api/v1/notification_events/user_defined_notifications/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /notification_events/{uuid}
Раздел: События.
Возвращает данные конкретного события оповещения по uuid
Назначение | URL запроса |
Возвращает данные конкретного события оповещения по uuid | https://{IP_контроллера}/api/v1/notification_events/b0de19a1-fcd2-42fd-9b13-500c21d8b057 |
Параметры запроса:
Наименование | Описание |
uuid* string (path) | UUID события |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
name | string | example: ACCESS_MODE_CHANGED | Наименование события |
timestamp* | number | $int64 | UNIX временная метка события в миллисекундах |
type* | string | minLength: 1
| Тип события |
reason* | string | minLength: 1 | Описание события |
controller* | string | Серийный номер контроллера события | |
source_type* | string | [HARDWARE, NETWORK, SERVICE, SECURITY, STAFF] | Тип источника события |
source* | string | UUID источника | |
error_code | integer | Для событий с типом ALERT и WARN сообщает об ошибке. Для событий с типом INFO сообщает какая ошибка была исправлена | Код ошибки |
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 0
}
Code 400 (Invalid UUID) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified event was not found) - запрос не выполнен, указанное событие не найдено
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns notification event with specified UUID",
"parameters": [
{
"name": "uuid",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Audit event uuid"
}
],
"responses": {
"200": {
"description": "Successfully got event with specified UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"timestamp",
"type",
"reason",
"controller",
"source_type",
"source"
],
"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}$",
"description": "Event UUID"
},
"name": {
"type": "string",
"example": "ACCESS_MODE_CHANGED",
"description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
},
"timestamp": {
"type": "number",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n *`INFO` - Информационное сообщение\n *`WARN` - Предупреждение\n *`ALERT` - Тревога\n",
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT",
"EVENT"
]
},
"reason": {
"description": "Event description",
"type": "string"
},
"controller": {
"description": "Event producer",
"type": "string"
},
"source_type": {
"description": "Event source type",
"type": "string",
"enum": [
"HARDWARE",
"NETWORK",
"SERVICE",
"SECURITY",
"STAFF"
]
},
"source": {
"type": "string",
"description": "Source id"
},
"error_code": {
"type": "integer",
"description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
}
}
}
}
}
},
"400": {
"description": "Invalid UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified event was not found",
"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_events/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 1.0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 1
}