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

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

PUT
/schedules/{schedule_id}

Авторизация

bearer
headerAuthorizationBearer <token>

Токен сервисного аккаунта. См. раздел «Аутентификация».

Параметры пути

schedule_id*number

Тело запроса

application/json
body
title*string
Длинаот 3 до 100 символов
template_id*number
assignee_user_id*number | null
assignee_group_id*number | null
allow_late_submit*boolean
duration*number
Диапазонот 1
repeat_rule*string | null
start_date*string
Форматdate-time
end_date*string | null
Форматdate-time

Тело ответа

responseapplication/json
type*string
По умолчанию"calendar"
Значения"calendar""adaptive"
organization_id*number
id*number
title*string
repeat_rule*string | null
duration*number
is_active*boolean
allow_late_submit*boolean
start_date*string
Форматdate-time
end_date*string | null
Форматdate-time
created_at*string
Форматdate-time
updated_at*string
Форматdate-time
data*object

Возможные ошибки

401Unauthorized

unauthorized: Необходима авторизация

{  "statusCode": 401,  "error": "unauthorized",  "message": "Необходима авторизация"}
403Forbidden

access_denied: Недостаточно прав

{  "statusCode": 403,  "error": "access_denied",  "message": "Недостаточно прав"}
404Not Found

schedule_not_found: Расписание не найдено

{  "statusCode": 404,  "error": "schedule_not_found",  "message": "Расписание не найдено"}
Пример запроса
curl -X PUT 'https://org.inspecto.in/api/schedules/0' \  -H 'Content-Type: application/json' \  -d '{  "title": "string",  "template_id": 0,  "assignee_user_id": 0,  "assignee_group_id": 0,  "allow_late_submit": true,  "duration": 1,  "repeat_rule": "string",  "adaptive_config": {    "anchor": "completed_at",    "catch_up_policy": "stop",    "interval": {      "unit": "hour",      "value": 0    },    "business_hours": {      "enabled": true,      "weekdays": [        0      ],      "time_from": "string",      "time_to": "string"    }  },  "start_date": "2019-08-24T14:15:22Z",  "end_date": "2019-08-24T14:15:22Z"}'
Пример ответа
{  "type": "calendar",  "organization_id": 0,  "id": 0,  "title": "string",  "repeat_rule": "string",  "duration": 0,  "is_active": true,  "allow_late_submit": true,  "start_date": "2019-08-24T14:15:22Z",  "end_date": "2019-08-24T14:15:22Z",  "assignee_user": {    "id": 0,    "email": "string",    "phone": "string",    "first_name": "string",    "last_name": "string",    "patronymic": "string",    "birthday": "2019-08-24T14:15:22Z",    "gender": 0,    "avatar": "string",    "created_at": "2019-08-24T14:15:22Z"  },  "assignee_group": {    "organization_id": 0,    "id": 0,    "code": "string",    "title": "string",    "description": "string",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  },  "template": {    "id": 0,    "organization_id": 0,    "unit": {      "id": 0,      "organization_id": 0,      "parent_unit_id": 0,      "code": "string",      "title": "string",      "description": "string",      "avatar": "string",      "background": "string",      "projects_enabled": true,      "features": {        "projects": true,        "cross_unit_tasks": true,        "cross_unit_findings": true      }    },    "code": "string",    "title": "string",    "avatar": "string",    "description": "string",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "status": 1,    "is_bookmarked": true,    "template_folder_id": 0  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "data": {},  "adaptive_config": {    "anchor": "completed_at",    "catch_up_policy": "stop",    "interval": {      "unit": "hour",      "value": 0    },    "business_hours": {      "enabled": true,      "weekdays": [        0      ],      "time_from": "string",      "time_to": "string"    }  }}