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

Расписания API 1.7.0

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

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

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

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

МетодПуть
GET/schedules
POST/schedules
GET/schedules/{uuid}
PUT/schedules/{uuid}
DELETE/schedules/{uuid}

GET /schedules

Раздел: Расписания.

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

Источник в Teamly

Назначение

URL запроса

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

https://{IP_контроллера}/api/v1/schedules/

Параметры запроса:

Отсутствуют

Варианты ответа:

Code 200 (Successfully returned all existing schedules) - удачное выполнение запроса

Название, * - обязательный

Тип

Формат

Назначение

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

Уникальный идентификатор рассписания

name*

string

/minLength: 1

Название

calendars*

[{

minItems: 3 maxItems: 3

календарь

year*

integer

minimum: 2022

год

calendar*

{

minProperties: 365 maxProperties: 366

“day.month”:”type”

Типы дней

0 - выходной,

1 - рабочий,

2 - сокращенный,

3 - специальный

описывает к какому типу относится каждый день в году в формате: { 'день.месяц': 'тип', - '1.11': '0' }

} }]

access_intervals*

{

интервалы доступа для разных типов дней : 0 - выходной, 1 - рабочий, 2 - сокращенный, 3 - специальный

0*

[{

интервалы доступа для выходных дней

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

1*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

2*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

3*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}] }

Пример:

Пример из Teamly сохранён дословно, но не является корректным JSON.

[{
"uuid": "0b7402b1-503f-11f1-9e4a-975446c45c79",
"name": "Расписание стандартное",
"calendars": [
{
"year": 2026,
"calendar": {
"11.3": "1",
...
"20.1": "1"
}
},
{
"year": 2027,
"calendar": {
"11.3": "1",
...
"20.1": "1"
}
},
{
"year": 2028,
"calendar": {
"11.3": "1",
...
"10.1": "1"
}
}
],
"access_intervals": {
"0": [],
"1": [
{
"from": "9:00",
"to": "17:00"
}
],
"2": [
{
"from": "9:00",
"to": "16:00"
}
],
"3": []
}
}]

Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке

Параметры и ответы по OpenAPI
{
"description": "Returns all existing schedules",
"parameters": [],
"responses": {
"200": {
"description": "Successfully returned all existing schedules",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"name",
"calendars",
"access_intervals"
],
"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",
"minLength": 1
},
"calendars": {
"type": "array",
"minItems": 3,
"maxItems": 3,
"items": {
"type": "object",
"minItems": 3,
"maxItems": 3,
"required": [
"year",
"calendar"
],
"properties": {
"year": {
"type": "integer",
"minimum": 2016
},
"calendar": {
"type": "object",
"minProperties": 365,
"maxProperties": 366,
"description": "Describes which dates are workdays or holidays in format: { '12.3': '1', '1.11': '0' }"
}
}
}
},
"access_intervals": {
"description": "Access intervals for different day types: 0 - holiday, 1 - workday, 2 - half-holiday, 3 - special day",
"type": "object",
"required": [
"0",
"1",
"2",
"3"
],
"properties": {
"0": {
"description": "holiday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"1": {
"description": "workday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"2": {
"description": "half-holiday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"3": {
"description": "user-defined",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
}
}
}
}
}
}
}
}
},
"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/schedules" \
-H "Authorization: Bearer <token>"

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

[
{
"uuid": "string",
"name": "string",
"calendars": [
{
"year": 2016,
"calendar": {}
}
],
"access_intervals": {
"0": [
{
"from": "strin",
"to": "strin"
}
],
"1": [
{
"from": "strin",
"to": "strin"
}
],
"2": [
{
"from": "strin",
"to": "strin"
}
],
"3": [
{
"from": "strin",
"to": "strin"
}
]
}
}
]

POST /schedules

Раздел: Расписания.

Добавляет новое расписание

Источник в Teamly

Назначение

URL запроса

Добавляет новое расписание

https://{IP контроллера}/api/v1/schedules

Параметры запроса:

Название

Тип

Описание

schedule*

object (body)

тело запроса

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

Уникальный идентификатор рассписания

name*

string

/minLength: 1

Название

calendars*

[{

minItems: 3 maxItems: 3

календарь

year*

integer

minimum: 2022

год

calendar*

{

minProperties: 365 maxProperties: 366

“day.month”:”type”

Типы дней

0 - выходной,

1 - рабочий,

2 - сокращенный,

3 - специальный

описывает к какому типу относится каждый день в году в формате: { 'день.месяц': 'тип', - '1.11': '0' }

} }]

access_intervals*

{

интервалы доступа для разных типов дней : 0 - выходной, 1 - рабочий, 2 - сокращенный, 3 - специальный

0*

[{

интервалы доступа для выходных дней

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

1*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

2*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

3*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}] }

Пример:

URL запроса: POST
https://{IP контроллера}/api/v1/schedules

Body

Пример из Teamly сохранён дословно, но не является корректным JSON.

{
"uuid": "0b7402b1-503f-11f1-9e4a-975446c45c79",
"name": "Новое расписание",
"calendars": [
{
"year": 2026,
"calendar": {
"11.3": "1",
...
"20.1": "1"
}
},
{
"year": 2027,
"calendar": {
"11.3": "1",
...
"20.1": "1"
}
},
{
"year": 2028,
"calendar": {
"11.3": "1",
...
"10.1": "1"
}
}
],
"access_intervals": {
"0": [],
"1": [
{
"from": "9:00",
"to": "17:00"
}
],
"2": [
{
"from": "9:00",
"to": "16:00"
}
],
"3": []
}
}

Варианты ответа:

Code 201 (Successfully created new schedule) - удачное выполнение запроса

Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса

Code 409 (Schedule already exists) - запрос не выполнен, расписание с указанным uuid уже добавлено в систему

Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке

Параметры и ответы по OpenAPI
{
"description": "Creates new schedule on server",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"name",
"calendars",
"access_intervals"
],
"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",
"minLength": 1
},
"calendars": {
"type": "array",
"minItems": 3,
"maxItems": 3,
"items": {
"type": "object",
"minItems": 3,
"maxItems": 3,
"required": [
"year",
"calendar"
],
"properties": {
"year": {
"type": "integer",
"minimum": 2016
},
"calendar": {
"type": "object",
"minProperties": 365,
"maxProperties": 366,
"description": "Describes which dates are workdays or holidays in format: { '12.3': '1', '1.11': '0' }"
}
}
}
},
"access_intervals": {
"description": "Access intervals for different day types: 0 - holiday, 1 - workday, 2 - half-holiday, 3 - special day",
"type": "object",
"required": [
"0",
"1",
"2",
"3"
],
"properties": {
"0": {
"description": "holiday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"1": {
"description": "workday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"2": {
"description": "half-holiday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"3": {
"description": "user-defined",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully created new schedule",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"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/schedules" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"name": "string",
"calendars": [
{
"year": 2016,
"calendar": {}
}
],
"access_intervals": {
"0": [
{
"from": "strin",
"to": "strin"
}
],
"1": [
{
"from": "strin",
"to": "strin"
}
],
"2": [
{
"from": "strin",
"to": "strin"
}
],
"3": [
{
"from": "strin",
"to": "strin"
}
]
}
}'

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

{
"uuid": "string",
"name": "string",
"calendars": [
{
"year": 2016,
"calendar": {}
}
],
"access_intervals": {
"0": [
{
"from": "strin",
"to": "strin"
}
],
"1": [
{
"from": "strin",
"to": "strin"
}
],
"2": [
{
"from": "strin",
"to": "strin"
}
],
"3": [
{
"from": "strin",
"to": "strin"
}
]
}
}

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

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

GET /schedules/{uuid}

Раздел: Расписания.

Возвращает настройки конкретного расписания

Источник в Teamly

Назначение

URL запроса

Возвращает настройки конкретного расписания

https://{IP_контроллера}/api/v1/schedules/74f566ed-fe7f-4b9d-a2ea-0dbe51a4d9be

Параметры запроса:

Наименование, * - обязательный

Описание

uuid* string (path)

uuid расписания

Варианты ответа:

Code 200 (Returns schedule with specified UUID) - удачное выполнение запроса

Название, * - обязательный

Тип

Формат

Назначение

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

Уникальный идентификатор рассписания

name*

string

/minLength: 1

Название

calendars*

[{

minItems: 3 maxItems: 3

календарь

year*

integer

minimum: 2022

год

calendar*

{

minProperties: 365 maxProperties: 366

“day.month”:”type”

Типы дней

0 - выходной,

1 - рабочий,

2 - сокращенный,

3 - специальный

описывает к какому типу относится каждый день в году в формате: { 'день.месяц': 'тип', - '1.11': '0' }

} }]

access_intervals*

{

интервалы доступа для разных типов дней : 0 - выходной, 1 - рабочий, 2 - сокращенный, 3 - специальный

0*

[{

интервалы доступа для выходных дней

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

1*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

2*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

3*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}] }

Пример:

Пример из Teamly сохранён дословно, но не является корректным JSON.

{
"uuid": "0b7402b1-503f-11f1-9e4a-975446c45c79",
"name": "Расписание стандартное",
"calendars": [
{
"year": 2026,
"calendar": {
"11.3": "1",
...
"20.1": "1"
}
},
{
"year": 2027,
"calendar": {
"11.3": "1",
...
"20.1": "1"
}
},
{
"year": 2028,
"calendar": {
"11.3": "1",
...
"10.1": "1"
}
}
],
"access_intervals": {
"0": [],
"1": [
{
"from": "9:00",
"to": "17:00"
}
],
"2": [
{
"from": "9:00",
"to": "16:00"
}
],
"3": []
}
}

Code 400 (Specified UUID is not valid) - запрос не выполнен, неверно указаны параметры запроса

Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке

Параметры и ответы по OpenAPI
{
"description": "Returns schedule with specified UUID",
"parameters": [
{
"name": "uuid",
"in": "path",
"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": "Returns schedule with specified UUID",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"uuid",
"name",
"calendars",
"access_intervals"
],
"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",
"minLength": 1
},
"calendars": {
"type": "array",
"minItems": 3,
"maxItems": 3,
"items": {
"type": "object",
"minItems": 3,
"maxItems": 3,
"required": [
"year",
"calendar"
],
"properties": {
"year": {
"type": "integer",
"minimum": 2016
},
"calendar": {
"type": "object",
"minProperties": 365,
"maxProperties": 366,
"description": "Describes which dates are workdays or holidays in format: { '12.3': '1', '1.11': '0' }"
}
}
}
},
"access_intervals": {
"description": "Access intervals for different day types: 0 - holiday, 1 - workday, 2 - half-holiday, 3 - special day",
"type": "object",
"required": [
"0",
"1",
"2",
"3"
],
"properties": {
"0": {
"description": "holiday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"1": {
"description": "workday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"2": {
"description": "half-holiday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"3": {
"description": "user-defined",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Specified UUID is not valid",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified schedule 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/schedules/{uuid}" \
-H "Authorization: Bearer <token>"

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

{
"uuid": "string",
"name": "string",
"calendars": [
{
"year": 2016,
"calendar": {}
}
],
"access_intervals": {
"0": [
{
"from": "strin",
"to": "strin"
}
],
"1": [
{
"from": "strin",
"to": "strin"
}
],
"2": [
{
"from": "strin",
"to": "strin"
}
],
"3": [
{
"from": "strin",
"to": "strin"
}
]
}
}

PUT /schedules/{uuid}

Раздел: Расписания.

Редактирует существующее расписание

Источник в Teamly

Назначение

URL запроса

Редактирует существующее расписание

https://{IP_контроллера}/api/v1/schedules/74f566ed-fe7f-4b9d-a2ea-0dbe51a4d9be

Параметры запроса:

Название

Тип

Описание

uuid*

string (path)

uuid расписания

schedule*

object (body)

тело запроса

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

Уникальный идентификатор рассписания

name*

string

/minLength: 1

Название

calendars*

[{

minItems: 3 maxItems: 3

календарь

year*

integer

minimum: 2022

год

calendar*

{

minProperties: 365 maxProperties: 366

“day.month”:”type”

Типы дней

0 - выходной,

1 - рабочий,

2 - сокращенный,

3 - специальный

описывает к какому типу относится каждый день в году в формате: { 'день.месяц': 'тип', - '1.11': '0' }

} }]

access_intervals*

{

интервалы доступа для разных типов дней : 0 - выходной, 1 - рабочий, 2 - сокращенный, 3 - специальный

0*

[{

интервалы доступа для выходных дней

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

1*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

2*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}]

3*

[{

from*

string

minLength: 4, maxLength: 5

начало действия доступа

to*

string

minLength: 4, maxLength: 5

окончание действия доступа

}] }

Пример:

URL запроса: PUT

https://{IP_контроллера}/api/v1/schedules/74f566ed-fe7f-4b9d-a2ea-0dbe51a4d9be

Body

Пример из Teamly сохранён дословно, но не является корректным JSON.

{
"uuid": "0b7402b1-503f-11f1-9e4a-975446c45c79",
"name": "Отредактированное расписание",
"calendars": [
{
"year": 2026,
"calendar": {
"11.3": "1",
...
"20.1": "1"
}
},
{
"year": 2027,
"calendar": {
"11.3": "1",
...
"20.1": "1"
}
},
{
"year": 2028,
"calendar": {
"11.3": "1",
...
"10.1": "1"
}
}
],
"access_intervals": {
"0": [],
"1": [
{
"from": "9:00",
"to": "17:00"
}
],
"2": [
{
"from": "9:00",
"to": "16:00"
}
],
"3": []
}
}

Варианты ответа:

Code 201 (Update succeeded) - удачное выполнение запроса

Code 400 (Specified UUID is not valid) - запрос не выполнен, указан некорректный uuid

Code 404 (Specified schedule does not exist) - запрос не выполнен, расписание с указанным uuid не существует

Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке

Параметры и ответы по OpenAPI
{
"description": "Updates schedule data",
"parameters": [
{
"name": "uuid",
"in": "path",
"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",
"name",
"calendars",
"access_intervals"
],
"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",
"minLength": 1
},
"calendars": {
"type": "array",
"minItems": 3,
"maxItems": 3,
"items": {
"type": "object",
"minItems": 3,
"maxItems": 3,
"required": [
"year",
"calendar"
],
"properties": {
"year": {
"type": "integer",
"minimum": 2016
},
"calendar": {
"type": "object",
"minProperties": 365,
"maxProperties": 366,
"description": "Describes which dates are workdays or holidays in format: { '12.3': '1', '1.11': '0' }"
}
}
}
},
"access_intervals": {
"description": "Access intervals for different day types: 0 - holiday, 1 - workday, 2 - half-holiday, 3 - special day",
"type": "object",
"required": [
"0",
"1",
"2",
"3"
],
"properties": {
"0": {
"description": "holiday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"1": {
"description": "workday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"2": {
"description": "half-holiday",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
},
"3": {
"description": "user-defined",
"type": "array",
"items": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"from": {
"description": "Time from access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
},
"to": {
"description": "Time till access is available",
"type": "string",
"minLength": 4,
"maxLength": 5
}
}
}
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Update succeeded",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Specified UUID is not valid",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified schedule 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/schedules/{uuid}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"name": "string",
"calendars": [
{
"year": 2016,
"calendar": {}
}
],
"access_intervals": {
"0": [
{
"from": "strin",
"to": "strin"
}
],
"1": [
{
"from": "strin",
"to": "strin"
}
],
"2": [
{
"from": "strin",
"to": "strin"
}
],
"3": [
{
"from": "strin",
"to": "strin"
}
]
}
}'

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

{
"uuid": "string",
"name": "string",
"calendars": [
{
"year": 2016,
"calendar": {}
}
],
"access_intervals": {
"0": [
{
"from": "strin",
"to": "strin"
}
],
"1": [
{
"from": "strin",
"to": "strin"
}
],
"2": [
{
"from": "strin",
"to": "strin"
}
],
"3": [
{
"from": "strin",
"to": "strin"
}
]
}
}

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

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

DELETE /schedules/{uuid}

Раздел: Расписания.

Удаляет существующее расписание

Источник в Teamly

Назначение

URL запроса

Удаляет существующее расписание

https://{IP_контроллера}/api/v1/schedules/74f566ed-fe7f-4b9d-a2ea-0dbe51a4d9be

Параметры запроса:

Наименование, * - обязательный

Описание

uuid* string (path)

uuid расписания

Варианты ответа:

Code 200 (Delete succeeded) - удачное выполнение запроса

Code 400 (Specified UUID is not valid) - запрос не выполнен, указан некорректный uuid

Code 404 (Specified schedule does not exist) - запрос не выполнен, расписание с указанным uuid не существует

Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке

Параметры и ответы по OpenAPI
{
"description": "Delete specified schedule",
"parameters": [
{
"name": "uuid",
"in": "path",
"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": "Delete succeeded",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Specified UUID is not valid",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Specified schedule 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/schedules/{uuid}" \
-H "Authorization: Bearer <token>"

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

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