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

Расписания точек прохода API 1.7.0

Методы API для работы с разделом «Расписания точек прохода».

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

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

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

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

GET /ap_schedules

Раздел: Расписания точек прохода.

Возвращает список расписаний точек прохода.

Параметры и ответы по OpenAPI
{
"description": "Returns list of Access point schedules",
"responses": {
"200": {
"description": "Successfully returned all Access point schedules",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"name",
"schedules",
"access_points",
"status"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string",
"description": "Schedule name"
},
"start_ms": {
"type": "integer",
"description": "Date time in ms when schedule starts"
},
"status": {
"type": "boolean",
"description": "Turn on schedule"
},
"access_points": {
"description": "Access points uuids for this schedule",
"type": "array",
"items": {
"type": "object",
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string"
}
}
}
},
"schedules": {
"type": "object",
"required": [
"sun",
"mon",
"tue",
"wed",
"thu",
"fri",
"sat"
],
"description": "Schedules by weekday",
"properties": {
"sun": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"mon": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"tue": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"wed": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"thu": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"fri": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"sat": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
}
}
}
}
}
}
}
}
},
"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/ap_schedules" \
-H "Authorization: Bearer <token>"

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

[
{
"uuid": "string",
"name": "string",
"start_ms": 1,
"status": true,
"access_points": [
{
"uuid": "string",
"name": "string"
}
],
"schedules": {
"sun": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"mon": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"tue": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"wed": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"thu": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"fri": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"sat": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
]
}
}
]

POST /ap_schedules

Раздел: Расписания точек прохода.

Создает расписание точки прохода.

Параметры и ответы по OpenAPI
{
"description": "Upload new channel",
"requestBody": {
"description": "JSON containing the new access point schedule",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"name",
"schedules",
"access_points",
"status"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string",
"description": "Schedule name"
},
"start_ms": {
"type": "integer",
"description": "Date time in ms when schedule starts"
},
"status": {
"type": "boolean",
"description": "Turn on schedule"
},
"access_points": {
"description": "Access points uuids for this schedule",
"type": "array",
"items": {
"type": "object",
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string"
}
}
}
},
"schedules": {
"type": "object",
"required": [
"sun",
"mon",
"tue",
"wed",
"thu",
"fri",
"sat"
],
"description": "Schedules by weekday",
"properties": {
"sun": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"mon": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"tue": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"wed": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"thu": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"fri": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"sat": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful operation"
},
"400": {
"description": "Invalid JSON file"
}
}
}

Примеры по OpenAPI

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

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

curl -k -X POST "https://{IP_контроллера}/api/v1/ap_schedules" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"name": "string",
"start_ms": 1,
"status": true,
"access_points": [
{
"uuid": "string",
"name": "string"
}
],
"schedules": {
"sun": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"mon": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"tue": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"wed": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"thu": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"fri": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"sat": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
]
}
}'

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

{
"uuid": "string",
"name": "string",
"start_ms": 1,
"status": true,
"access_points": [
{
"uuid": "string",
"name": "string"
}
],
"schedules": {
"sun": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"mon": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"tue": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"wed": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"thu": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"fri": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"sat": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
]
}
}

GET /ap_schedules/{id}

Раздел: Расписания точек прохода.

Возвращает расписание точки прохода.

Параметры и ответы по OpenAPI
{
"description": "Get access point schedule",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "Access point schedule ID",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"name",
"schedules",
"access_points",
"status"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string",
"description": "Schedule name"
},
"start_ms": {
"type": "integer",
"description": "Date time in ms when schedule starts"
},
"status": {
"type": "boolean",
"description": "Turn on schedule"
},
"access_points": {
"description": "Access points uuids for this schedule",
"type": "array",
"items": {
"type": "object",
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string"
}
}
}
},
"schedules": {
"type": "object",
"required": [
"sun",
"mon",
"tue",
"wed",
"thu",
"fri",
"sat"
],
"description": "Schedules by weekday",
"properties": {
"sun": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"mon": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"tue": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"wed": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"thu": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"fri": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"sat": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Bad request",
"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/ap_schedules/{id}" \
-H "Authorization: Bearer <token>"

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

{
"uuid": "string",
"name": "string",
"start_ms": 1,
"status": true,
"access_points": [
{
"uuid": "string",
"name": "string"
}
],
"schedules": {
"sun": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"mon": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"tue": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"wed": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"thu": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"fri": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"sat": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
]
}
}

PUT /ap_schedules/{id}

Раздел: Расписания точек прохода.

Обновляет расписание точки прохода.

Параметры и ответы по OpenAPI
{
"description": "Update point schedule",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "Access point schedule ID",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "JSON containing the access point schedule",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"name",
"schedules",
"access_points",
"status"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string",
"description": "Schedule name"
},
"start_ms": {
"type": "integer",
"description": "Date time in ms when schedule starts"
},
"status": {
"type": "boolean",
"description": "Turn on schedule"
},
"access_points": {
"description": "Access points uuids for this schedule",
"type": "array",
"items": {
"type": "object",
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"name": {
"type": "string"
}
}
}
},
"schedules": {
"type": "object",
"required": [
"sun",
"mon",
"tue",
"wed",
"thu",
"fri",
"sat"
],
"description": "Schedules by weekday",
"properties": {
"sun": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"mon": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"tue": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"wed": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"thu": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"fri": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
},
"sat": {
"type": "array",
"description": "Schedules array for given weekday",
"items": {
"type": "object",
"required": [
"hour",
"minute",
"state"
],
"properties": {
"hour": {
"description": "Hour when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 24
},
"minute": {
"description": "Minute when set access point state",
"type": "integer",
"minimum": 0,
"maximum": 60
},
"state": {
"description": "State to set on schedule",
"type": "string",
"enum": [
"NORMAL",
"BLOCKED",
"BLOCKED_SIDE_A",
"BLOCKED_SIDE_B",
"UNBLOCKED",
"GUARDED"
]
}
}
}
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful operation",
"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"
}
}
}
}
}
}
}
}

Примеры по OpenAPI

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

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

curl -k -X PUT "https://{IP_контроллера}/api/v1/ap_schedules/{id}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"name": "string",
"start_ms": 1,
"status": true,
"access_points": [
{
"uuid": "string",
"name": "string"
}
],
"schedules": {
"sun": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"mon": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"tue": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"wed": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"thu": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"fri": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"sat": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
]
}
}'

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

{
"uuid": "string",
"name": "string",
"start_ms": 1,
"status": true,
"access_points": [
{
"uuid": "string",
"name": "string"
}
],
"schedules": {
"sun": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"mon": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"tue": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"wed": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"thu": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"fri": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
],
"sat": [
{
"hour": 1,
"minute": 1,
"state": "NORMAL"
}
]
}
}

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

{
"success": false,
"message": "string",
"data": {}
}

DELETE /ap_schedules/{id}

Раздел: Расписания точек прохода.

Удаляет расписание точки прохода.

Параметры и ответы по OpenAPI
{
"description": "Delete point schedule",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "Access point schedule ID",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful operation",
"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"
}
}
}
}
}
}
}
}

Примеры по OpenAPI

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

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

curl -k -X DELETE "https://{IP_контроллера}/api/v1/ap_schedules/{id}" \
-H "Authorization: Bearer <token>"

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

{
"success": false,
"message": "string",
"data": {}
}