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

Проверка доступа API 1.7.0

Методы API для работы с разделом «Проверка доступа».

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

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

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

МетодПуть
POST/check_access

POST /check_access

Раздел: Проверка доступа.

Выполняет запрос доступа пользователя через точку прохода.

Параметры и ответы по OpenAPI
{
"description": "Make access request for user through access point",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"user_uuid",
"access_point_uuid",
"from_side"
],
"properties": {
"event_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}$"
},
"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}$"
},
"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}$"
},
"from_side": {
"type": "string",
"enum": [
"a",
"b"
]
},
"privilege": {
"type": "integer",
"description": "Access privilege level"
},
"card_code": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully created access request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success",
"message",
"access"
],
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
},
"access": {
"type": "string"
},
"reason": {
"type": "string"
}
}
}
}
}
},
"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 POST "https://{IP_контроллера}/api/v1/check_access" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"event_uuid": "string",
"user_uuid": "string",
"access_point_uuid": "string",
"from_side": "a",
"privilege": 1,
"card_code": "string"
}'

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

{
"event_uuid": "string",
"user_uuid": "string",
"access_point_uuid": "string",
"from_side": "a",
"privilege": 1,
"card_code": "string"
}

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

{
"success": true,
"message": "string",
"access": "string",
"reason": "string"
}