Идентификаторы API 1.7.0
Методы API для работы с разделом «Идентификаторы».
Базовый путь: https://{IP_контроллера}/api/v1.
Версия описания API: 1.7.0.
Примеры используют placeholder-значения для паролей, token, UUID, адресов и секретов. Перед выполнением запроса замените их на значения вашего контроллера.
Методы раздела
GET /identifiers
Раздел: Идентификаторы.
Возвращает постраничный список добавленных в систему идентификаторов и их параметры
Назначение | URL запроса |
Возвращает постраничный список добавленных в систему идентификаторов и их параметры | https://{IP контроллера}/api/v1/identifiers?page=1&page_size=2 |
Параметры запроса:
Наименование | Описание |
page* integer (query) page_size* integer (query) | Страница выводимого списка Количество карточек на одной странице |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
code* | string | minLength: 1 pattern: ^[1-9]\d*$ | Номер идентификатора |
privilege* | string | Уровень привилегий | |
disposable* | boolean | true – разовая, false - многоразовая | Категория идентификатора |
no_expire_delete | boolean | Удаление без срока действия | |
active_from* | integer | $int64 | Начало действия идентификатора UNIX временная метка в миллисекундах |
active_to integer | integer | $int64 | Конец действия идентификатора UNIX временная метка в миллисекундах |
user_uuid | string | UUID сотрудника, к которому привязан идентификатор | |
comment | string | Комментарий | |
format* | string | [ qr, barcode, card ] | Тип идентификатора |
ext_privileges | [SET_AP_STATE - Установка режима точек прохода (кроме постановки/снятия режима охраны), SET_ON_GUARD - Постановка точки прохода на охрану, UNSET_ON_GUARD - Снятие точки прохода с охраны, START_AUTOMATION - Запуск автоматизации, CONFIRM_ACCESS - Подтверждение прохода, EASY_ACCESS - Упрощенный проход] | Список дополнительных привилегий |
Пример:
[
{
"code": "string",
"privilege": 0,
"disposable": true,
"no_expire_delete": true,
"active_from": 0,
"active_to": 0,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}
]
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns list of identifiers",
"parameters": [
{
"in": "query",
"name": "page",
"description": "Cards page id to load",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"in": "query",
"name": "page_size",
"description": "Maximum number of cards in page",
"required": true,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200
}
}
],
"responses": {
"200": {
"description": "Successfully returned specified page of registered cards",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"privilege",
"disposable",
"active_from",
"active_to",
"format"
],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"pattern": "^[1-9]\\d*$"
},
"privilege": {
"type": "integer"
},
"disposable": {
"type": "boolean"
},
"no_expire_delete": {
"type": "boolean"
},
"active_from": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
},
"active_to": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
},
"user_uuid": {
"type": "string"
},
"comment": {
"type": "string"
},
"format": {
"type": "string",
"description": "Identifier format",
"enum": [
"qr",
"barcode",
"card"
]
},
"ext_privileges": {
"type": "array",
"items": {
"type": "string",
"enum": [
"SET_AP_STATE",
"SET_ON_GUARD",
"UNSET_ON_GUARD",
"START_AUTOMATION",
"CONFIRM_ACCESS",
"EASY_ACCESS",
"SKIP_ZONES_CONTROL"
]
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/identifiers?page=1&page_size=1" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"code": "string",
"privilege": 1,
"disposable": true,
"no_expire_delete": true,
"active_from": 1,
"active_to": 1,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}
]
POST /identifiers
Раздел: Идентификаторы.
Добавляет новый идентификатор в систему
Назначение | URL запроса |
Добавляет новый идентификатор в систему | https://{IP контроллера}/api/v1/identifiers/ |
Параметры запроса:
Наименование | Тип | Описание | |
identifier* | object (body) | Тело запроса | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
code* | string | minLength: 1 pattern: ^[1-9]\d*$ | Номер идентификатора |
privilege* | string | Уровень привилегий | |
disposable* | boolean | true – разовая, false - многоразовая | Категория идентификатора |
no_expire_delete | boolean | Удаление без срока действия | |
active_from* | integer | $int64 | Начало действия идентификатора UNIX временная метка в миллисекундах |
active_to integer | integer | $int64 | Конец действия идентификатора UNIX временная метка в миллисекундах |
user_uuid | string | UUID сотрудника, к которому привязан идентификатор | |
comment | string | Комментарий | |
format* | string | [ qr, barcode, card ] | Тип идентификатора |
ext_privileges | [SET_AP_STATE - Установка режима точек прохода (кроме постановки/снятия режима охраны), SET_ON_GUARD - Постановка точки прохода на охрану, UNSET_ON_GUARD - Снятие точки прохода с охраны, START_AUTOMATION - Запуск автоматизации, CONFIRM_ACCESS - Подтверждение прохода, EASY_ACCESS - Упрощенный проход] | Список дополнительных привилегий | |
Пример:
URL запроса: POST
https://{IP контроллера}/api/v1/identifiers/
Body:
Пример с исправленным синтаксисом JSON
Добавлены запятые после active_to и format; значения полей сохранены.
{
"code": "678909876",
"privilege": 30,
"disposable": true,
"active_from": 1803157199999,
"active_to": 1900005244562,
"comment": "Добавлена через метод api",
"format": "card",
"ext_privileges":
["SET_AP_STATE"]
}
Исходный пример Teamly
Пример из Teamly сохранён дословно, но не является корректным JSON.
{
"code": "678909876",
"privilege": 30,
"disposable": true,
"active_from": 1803157199999,
"active_to": 1900005244562
"comment": "Добавлена через метод api",
"format": "card"
"ext_privileges":
["SET_AP_STATE"]
}
Варианты ответа:
Code 201 (Successfully) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 409 (Identifier already exists) - запрос не выполнен, указанный идентификатор уже добавлен
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Add new identifier to system",
"requestBody": {
"description": "Creates new identifier in database",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"code",
"privilege",
"disposable",
"active_from",
"active_to",
"format"
],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"pattern": "^[1-9]\\d*$"
},
"privilege": {
"type": "integer"
},
"disposable": {
"type": "boolean"
},
"no_expire_delete": {
"type": "boolean"
},
"active_from": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
},
"active_to": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
},
"user_uuid": {
"type": "string"
},
"comment": {
"type": "string"
},
"format": {
"type": "string",
"description": "Identifier format",
"enum": [
"qr",
"barcode",
"card"
]
},
"ext_privileges": {
"type": "array",
"items": {
"type": "string",
"enum": [
"SET_AP_STATE",
"SET_ON_GUARD",
"UNSET_ON_GUARD",
"START_AUTOMATION",
"CONFIRM_ACCESS",
"EASY_ACCESS",
"SKIP_ZONES_CONTROL"
]
}
}
}
}
}
}
},
"responses": {
"201": {
"description": "Identifier has been successfully added",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"409": {
"description": "Identifier already exists",
"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 POST "https://{IP_контроллера}/api/v1/identifiers" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"code": "string",
"privilege": 1,
"disposable": true,
"no_expire_delete": true,
"active_from": 1,
"active_to": 1,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}'
Пример тела запроса
{
"code": "string",
"privilege": 1,
"disposable": true,
"no_expire_delete": true,
"active_from": 1,
"active_to": 1,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /identifiers/count
Раздел: Идентификаторы.
Возвращает количество добавленных в систему идентификаторов
Назначение | URL запроса |
Возвращает количество добавленных в систему идентификаторов | https://{IP контроллера}/api/v1/identifiers/count |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Пример:
{
"count": 0
}
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Get cards overall count",
"responses": {
"200": {
"description": "Successfully got cards overall count",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"count"
],
"properties": {
"count": {
"type": "integer"
}
}
}
}
}
},
"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/identifiers/count" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"count": 1
}
GET /identifiers/ext_privileges
Раздел: Идентификаторы.
Возвращает список дополнительных привилегий
Назначение | URL запроса |
Возвращает список дополнительных привилегий | https://{IP контроллера}/api/v1/identifiers/ext_privileges |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Пример:
Пример с исправленным синтаксисом JSON
Добавлена запятая между объектами массива.
[
{
"name": "SET_AP_STATE",
"description": "Установка режима точек прохода (кроме постановки/снятия режима охраны)"
},
{
"name": "SET_ON_GUARD",
"description": "Постановка точки прохода на охрану"
},
{
"name": "UNSET_ON_GUARD",
"description": "Снятие точки прохода с охраны"
},
{
"name": "START_AUTOMATION",
"description": "Запуск автоматизации"
},
{
"name": "CONFIRM_ACCESS",
"description": "Подтверждение прохода"
},
{
"name": "EASY_ACCESS",
"description": "Упрощенный проход"
}
]
Исходный пример Teamly
Пример из Teamly сохранён дословно, но не является корректным JSON.
[
{
"name": "SET_AP_STATE",
"description": "Установка режима точек прохода (кроме постановки/снятия режима охраны)"
},
{
"name": "SET_ON_GUARD",
"description": "Постановка точки прохода на охрану"
},
{
"name": "UNSET_ON_GUARD",
"description": "Снятие точки прохода с охраны"
},
{
"name": "START_AUTOMATION",
"description": "Запуск автоматизации"
},
{
"name": "CONFIRM_ACCESS",
"description": "Подтверждение прохода"
}
{
"name": "EASY_ACCESS",
"description": "Упрощенный проход"
}
]
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Get identifiers extended privileges description",
"responses": {
"200": {
"description": "Successfully got identifiers ext privileges description",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"description"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
}
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/identifiers/ext_privileges" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"name": "string",
"description": "string"
}
]
GET /identifiers/filter/{filter}
Раздел: Идентификаторы.
Возвращает отфильтрованные идентификаторы
Назначение | URL запроса |
Возвращает отфильтрованные идентификаторы | https://{IP контроллера}/api/v1/identifiers/filter/{filter} |
Параметры запроса:
Наименование | Описание |
filter* string (query) page * integer (query) page_size* integer (query) | Тип фильтра (например card) Страница выводимого списка Количество карточек на одной странице |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
code* | string | minLength: 1 pattern: ^[1-9]\d*$ | Номер идентификатора |
privilege* | string | Уровень привилегий | |
disposable* | boolean | true – разовая, false - многоразовая | Категория идентификатора |
no_expire_delete | boolean | Удаление без срока действия | |
active_from* | integer | $int64 | Начало действия идентификатора UNIX временная метка в миллисекундах |
active_to integer | integer | $int64 | Конец действия идентификатора UNIX временная метка в миллисекундах |
user_uuid | string | UUID сотрудника, к которому привязан идентификатор | |
comment | string | Комментарий | |
format* | string | [ qr, barcode, card ] | Тип идентификатора |
ext_privileges | [SET_AP_STATE - Установка режима точек прохода (кроме постановки/снятия режима охраны), SET_ON_GUARD - Постановка точки прохода на охрану, UNSET_ON_GUARD - Снятие точки прохода с охраны, START_AUTOMATION - Запуск автоматизации, CONFIRM_ACCESS - Подтверждение прохода, EASY_ACCESS - Упрощенный проход] | Список дополнительных привилегий | |
Пример:
[
{
"code": "string",
"privilege": 0,
"disposable": true,
"no_expire_delete": true,
"active_from": 0,
"active_to": 0,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}
]
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns filtered items",
"parameters": [
{
"in": "path",
"name": "filter",
"required": true,
"description": "The filter type (e.g., 'card')",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "page",
"description": "Identifiers page id to load",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"in": "query",
"name": "page_size",
"description": "Maximum number of cards in page",
"required": true,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 150
}
}
],
"responses": {
"200": {
"description": "Successfully returned specified page of registered cards",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"privilege",
"disposable",
"active_from",
"active_to",
"format"
],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"pattern": "^[1-9]\\d*$"
},
"privilege": {
"type": "integer"
},
"disposable": {
"type": "boolean"
},
"no_expire_delete": {
"type": "boolean"
},
"active_from": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
},
"active_to": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
},
"user_uuid": {
"type": "string"
},
"comment": {
"type": "string"
},
"format": {
"type": "string",
"description": "Identifier format",
"enum": [
"qr",
"barcode",
"card"
]
},
"ext_privileges": {
"type": "array",
"items": {
"type": "string",
"enum": [
"SET_AP_STATE",
"SET_ON_GUARD",
"UNSET_ON_GUARD",
"START_AUTOMATION",
"CONFIRM_ACCESS",
"EASY_ACCESS",
"SKIP_ZONES_CONTROL"
]
}
}
}
}
}
}
}
},
"400": {
"description": "Bad request 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/identifiers/filter/{filter}?page=1&page_size=1" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"code": "string",
"privilege": 1,
"disposable": true,
"no_expire_delete": true,
"active_from": 1,
"active_to": 1,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}
]
GET /identifiers/generate
Раздел: Идентификаторы.
Генерирует случайный код идентификатора заданного формата.
Параметры и ответы по OpenAPI
{
"description": "Get random identifier code for given format",
"parameters": [
{
"in": "query",
"name": "format",
"required": true,
"schema": {
"type": "string",
"enum": [
"qr",
"barcode"
]
}
}
],
"responses": {
"200": {
"description": "Successfully got identifier random code",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"code"
],
"properties": {
"code": {
"type": "integer"
}
}
}
}
}
},
"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/identifiers/generate?format=qr" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"code": 1
}
GET /identifiers/search
Раздел: Идентификаторы.
Возвращает постраничный список найденных идентификаторов по параметру запроса
Назначение | URL запроса |
Возвращает постраничный список найденных идентификаторов по параметру запроса | https://{IP_контроллера}/api/v1/identifiers/search?search_query=5&page_size=2&cursor=1 |
Параметры запроса:
Наименование | Описание |
search_query* string (query) page_size* integer (query) cursor integer (query) | Номер карты или его часть Количество записей на странице Номер строки, с которой осуществляется поиск |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
count | integer | minimum: 0 | Общее количество найденных совпадений |
page* | integer | minimum: 1, maximum: 50 | Страница вывода |
cursor* | integer | minimum: 0 | Положение курсора для следующего поиска |
cards* | [{ code* string /minLength: 1 pattern: ^[1-9]\d*$ Номер идентификатора privilege* integer /Уровень привилегий disposable* boolean /Категория идентификатора: true – разовая, false - многоразовая no_expire_delete boolean active_from* integer($int64) /Начало действия идентификатора UNIX временная метка в миллисекундах active_to integer($int64) /Конец действия идентификатора UNIX временная метка в миллисекундах user_uuid string /uuid сотрудника, к которому привязан идентификатор comment string /Комментарий format* string /Тип идентификатора Варианты: [ qr, barcode, card ] ext_privileges /Список дополнительных привилегий Варианты: [SET_AP_STATE - Установка режима точек прохода (кроме постановки/снятия режима охраны), SET_ON_GUARD - Постановка точки прохода на охрану, UNSET_ON_GUARD - Снятие точки прохода с охраны, START_AUTOMATION - Запуск автоматизации, CONFIRM_ACCESS - Подтверждение прохода, EASY_ACCESS - Упрощенный проход] [string] | Данные идентификатора |
Пример:
{
"count": 0,
"page": 50,
"cursor": 0,
"cards": [
{
"code": "string",
"privilege": 0,
"disposable": true,
"expire": 0,
"user_uuid": "string",
"comment": "string",
"ext_privileges": [
"SET_AP_STATE"
]
}
]
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Search for identifiers by part of code as substring of code string",
"parameters": [
{
"in": "query",
"name": "search_query",
"required": true,
"description": "Identifier code search query",
"schema": {
"type": "string",
"minLength": 1
}
},
{
"in": "query",
"name": "page_size",
"required": true,
"description": "Search results maximum page size",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 50
}
},
{
"in": "query",
"name": "cursor",
"required": false,
"description": "Cursor to proceed search from, if skipped, starts search from beginning and calculates all results count",
"schema": {
"type": "integer",
"minimum": 0
}
}
],
"responses": {
"200": {
"description": "Successfully returned found identifiers page",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"page",
"cursor",
"cards"
],
"properties": {
"count": {
"type": "integer",
"minimum": 0,
"description": "Overall search results count, calculated only when cursor was not specified in requst"
},
"page": {
"type": "integer",
"minimum": 1,
"maximum": 50
},
"cursor": {
"type": "integer",
"minimum": 0,
"description": "Next element to search from to get next search page, or 0 if search stopped"
},
"cards": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"privilege",
"disposable",
"expire"
],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"pattern": "^[1-9]\\d*$"
},
"privilege": {
"type": "integer"
},
"disposable": {
"type": "boolean"
},
"expire": {
"type": "integer",
"format": "int64",
"description": "Card expiration UNIX timestamp in milliseconds"
},
"user_uuid": {
"type": "string"
},
"comment": {
"type": "string"
},
"ext_privileges": {
"type": "array",
"items": {
"type": "string",
"enum": [
"SET_AP_STATE",
"SET_ON_GUARD",
"UNSET_ON_GUARD",
"START_AUTOMATION",
"CONFIRM_ACCESS",
"EASY_ACCESS",
"SKIP_ZONES_CONTROL"
]
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "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/identifiers/search?search_query=<search_query>&page_size=1" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"count": 1,
"page": 1,
"cursor": 1,
"cards": [
{
"code": "string",
"privilege": 1,
"disposable": true,
"expire": 1,
"user_uuid": "string",
"comment": "string",
"ext_privileges": [
"SET_AP_STATE"
]
}
]
}
GET /identifiers/sort
Раздел: Идентификаторы.
Возвращает список идентификаторов, отсортированных по столбцу
Назначение | URL запроса |
Возвращает список идентификаторов, отсортированных по столбцу | https://{IP_контроллера}/api/v1/identifier/sort |
Параметры запроса:
Наименование | Описание |
рage* integer (query) column_name* string (query) page_size* integer (query) direction* string (query) | Страница выводимого списка Сортируемый столбец (user, active_from, active_to) Максимальное количество карточек на странице Направление сортировки ASC или DESC |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
code* | string | minLength: 1 pattern: ^[1-9]\d*$ | Номер идентификатора |
privilege* | string | Уровень привилегий | |
disposable* | boolean | true – разовая, false - многоразовая | Категория идентификатора |
active_from* | integer | $int64 | Начало действия идентификатора UNIX временная метка в миллисекундах |
active_to integer | integer | $int64 | Конец действия идентификатора UNIX временная метка в миллисекундах |
user_uuid | string | UUID сотрудника, к которому привязан идентификатор | |
comment | string | Комментарий | |
format* | string | [ qr, barcode, card ] | Тип идентификатора |
ext_privileges | [SET_AP_STATE - Установка режима точек прохода (кроме постановки/снятия режима охраны), SET_ON_GUARD - Постановка точки прохода на охрану, UNSET_ON_GUARD - Снятие точки прохода с охраны, START_AUTOMATION - Запуск автоматизации, CONFIRM_ACCESS - Подтверждение прохода, EASY_ACCESS - Упрощенный проход] | Список дополнительных привилегий |
Пример:
[
{
"code": "string",
"privilege": 0,
"disposable": true,
"no_expire_delete": true,
"active_from": 0,
"active_to": 0,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}
]
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns sorted by column_name identifiers page",
"parameters": [
{
"in": "query",
"name": "page",
"description": "Identifiers page id to load",
"required": true,
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"in": "query",
"name": "column_name",
"description": "Sortable column",
"required": true,
"schema": {
"type": "string",
"minimum": 1
}
},
{
"in": "query",
"name": "page_size",
"description": "Maximum number of cards in page",
"required": true,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 150
}
},
{
"in": "query",
"name": "direction",
"description": "Direction of sorting ASC or DESC",
"required": true,
"schema": {
"type": "string",
"enum": [
"ASC",
"DESC"
]
}
}
],
"responses": {
"200": {
"description": "Successfully returned specified page of registered cards",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"privilege",
"disposable",
"active_from",
"active_to",
"format"
],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"pattern": "^[1-9]\\d*$"
},
"privilege": {
"type": "integer"
},
"disposable": {
"type": "boolean"
},
"no_expire_delete": {
"type": "boolean"
},
"active_from": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
},
"active_to": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
},
"user_uuid": {
"type": "string"
},
"comment": {
"type": "string"
},
"format": {
"type": "string",
"description": "Identifier format",
"enum": [
"qr",
"barcode",
"card"
]
},
"ext_privileges": {
"type": "array",
"items": {
"type": "string",
"enum": [
"SET_AP_STATE",
"SET_ON_GUARD",
"UNSET_ON_GUARD",
"START_AUTOMATION",
"CONFIRM_ACCESS",
"EASY_ACCESS",
"SKIP_ZONES_CONTROL"
]
}
}
}
}
}
}
}
},
"400": {
"description": "Bad request 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/identifiers/sort?page=1&column_name=<column_name>&page_size=1&direction=ASC" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"code": "string",
"privilege": 1,
"disposable": true,
"no_expire_delete": true,
"active_from": 1,
"active_to": 1,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}
]
GET /identifiers/{code}
Раздел: Идентификаторы.
Возвращает данные указанного идентификатора.
Параметры и ответы по OpenAPI
{
"description": "Get specified identifier data",
"parameters": [
{
"name": "code",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successfully got identifier with specified code",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"code",
"privilege",
"disposable",
"active_from",
"active_to",
"format"
],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"pattern": "^[1-9]\\d*$"
},
"privilege": {
"type": "integer"
},
"disposable": {
"type": "boolean"
},
"no_expire_delete": {
"type": "boolean"
},
"active_from": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
},
"active_to": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
},
"user_uuid": {
"type": "string"
},
"comment": {
"type": "string"
},
"format": {
"type": "string",
"description": "Identifier format",
"enum": [
"qr",
"barcode",
"card"
]
},
"ext_privileges": {
"type": "array",
"items": {
"type": "string",
"enum": [
"SET_AP_STATE",
"SET_ON_GUARD",
"UNSET_ON_GUARD",
"START_AUTOMATION",
"CONFIRM_ACCESS",
"EASY_ACCESS",
"SKIP_ZONES_CONTROL"
]
}
}
}
}
}
}
},
"400": {
"description": "Bad request (card code is not valid integer)",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified identifier 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 GET "https://{IP_контроллера}/api/v1/identifiers/{code}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"code": "string",
"privilege": 1,
"disposable": true,
"no_expire_delete": true,
"active_from": 1,
"active_to": 1,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}
PUT /identifiers/{code}
Раздел: Идентификаторы.
Позволяет отредактировать параметры конкретного идентификатора по номеру
Назначение | URL запроса |
Позволяет отредактировать параметры конкретного идентификатора по номеру | https://{IP контроллера}/api/v1/identifiers/678909876 |
Параметры запроса:
Наименование | Тип | Описание | |
code* identifier* | string (path) object (body) | Номер существующего идентификатора Тело запроса | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
code* | string | minLength: 1 pattern: ^[1-9]\d*$ | Номер идентификатора |
privilege* | string | Уровень привилегий | |
disposable* | boolean | true – разовая, false - многоразовая | Категория идентификатора |
no_expire_delete | boolean | Удаление без срока действия | |
active_from* | integer | $int64 | Начало действия идентификатора UNIX временная метка в миллисекундах |
active_to integer | integer | $int64 | Конец действия идентификатора UNIX временная метка в миллисекундах |
user_uuid | string | UUID сотрудника, к которому привязан идентификатор | |
comment | string | Комментарий | |
format* | string | [ qr, barcode, card ] | Тип идентификатора |
ext_privileges | [SET_AP_STATE - Установка режима точек прохода (кроме постановки/снятия режима охраны), SET_ON_GUARD - Постановка точки прохода на охрану, UNSET_ON_GUARD - Снятие точки прохода с охраны, START_AUTOMATION - Запуск автоматизации, CONFIRM_ACCESS - Подтверждение прохода, EASY_ACCESS - Упрощенный проход] | Список дополнительных привилегий | |
Пример:
URL запроса: PUT
https://{IP контроллера}/api/v1/identifiers/678909876
Body:
Пример с исправленным синтаксисом JSON
Добавлены запятые после active_to и format; значения полей сохранены.
{
"code": "678909876",
"privilege": 300,
"disposable": true,
"active_from": 1803157199999,
"active_to": 1900005244562,
"comment": "Отредактирована через метод api",
"format": "card",
"ext_privileges":
["SET_AP_STATE"]
}
Исходный пример Teamly
Пример из Teamly сохранён дословно, но не является корректным JSON.
{
"code": "678909876",
"privilege": 300,
"disposable": true,
"active_from": 1803157199999,
"active_to": 1900005244562
"comment": "Отредактирована через метод api",
"format": "card"
"ext_privileges":
["SET_AP_STATE"]
}
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
Пример из Teamly сохранён дословно, но не является корректным JSON.
{
success* boolean
message string
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified card does not exist) - запрос не выполнен, указанный идентификатор не существует
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Modify specified identifier data",
"parameters": [
{
"name": "code",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^[1-9]\\d*$"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"code",
"privilege",
"disposable",
"active_from",
"active_to",
"format"
],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"pattern": "^[1-9]\\d*$"
},
"privilege": {
"type": "integer"
},
"disposable": {
"type": "boolean"
},
"no_expire_delete": {
"type": "boolean"
},
"active_from": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the start of Identifier in milliseconds, if value equal 0 set timestamp as start of current day"
},
"active_to": {
"type": "integer",
"format": "int64",
"description": "UNIX timestamp of the end of Identifier in milliseconds, if value equal 0 set timestamp as end of current day"
},
"user_uuid": {
"type": "string"
},
"comment": {
"type": "string"
},
"format": {
"type": "string",
"description": "Identifier format",
"enum": [
"qr",
"barcode",
"card"
]
},
"ext_privileges": {
"type": "array",
"items": {
"type": "string",
"enum": [
"SET_AP_STATE",
"SET_ON_GUARD",
"UNSET_ON_GUARD",
"START_AUTOMATION",
"CONFIRM_ACCESS",
"EASY_ACCESS",
"SKIP_ZONES_CONTROL"
]
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully modified card data",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Invalid parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified card 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 PUT "https://{IP_контроллера}/api/v1/identifiers/{code}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"code": "string",
"privilege": 1,
"disposable": true,
"no_expire_delete": true,
"active_from": 1,
"active_to": 1,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}'
Пример тела запроса
{
"code": "string",
"privilege": 1,
"disposable": true,
"no_expire_delete": true,
"active_from": 1,
"active_to": 1,
"user_uuid": "string",
"comment": "string",
"format": "qr",
"ext_privileges": [
"SET_AP_STATE"
]
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
DELETE /identifiers/{code}
Раздел: Идентификаторы.
Позволяет удалить существующую идентификатор по номеру
Назначение | URL запроса |
Позволяет удалить существующую идентификатор по номеру | https://{IP контроллера}/api/v1/identifiers/678909876 |
Параметры запроса:
Наименование | Описание |
code* string (path) | Номер существующего идентификатора |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Invalid card code) - запрос не выполнен, неверно указан номер идентификатора
Code 404 (Specified card does not exist) - запрос не выполнен, идентификатор с указанным номером не найден
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Delete identifier",
"parameters": [
{
"name": "code",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^[1-9]\\d*$"
}
}
],
"responses": {
"200": {
"description": "Successfully deleted identifier",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Invalid identifier code",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified identifier 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/identifiers/{code}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}