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

Изменить данные шаблона

PATCH
/templates/{template_id}

Авторизация

bearer
headerAuthorizationBearer <token>

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

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

template_id*number

Тело запроса

application/json
body
template_folder_id?number | null
title?string
Длинаот 3 до 100 символов
description?string | null
Длинаот 0 до 250 символов
status?number
Значения1510
avatar?string | null
Длинаот 0 до 250 символов

Тело ответа

responseapplication/json
id*number
organization_id*number
code*string
title*string
avatar*string | null
description*string | null
created_at*string
Форматdate-time
updated_at*string
Форматdate-time
status*number
Значения1510
is_bookmarked?boolean
template_folder_id?number | null

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

400Bad Request

template_derived_value_invalid: Некорректная настройка производного значения вопроса

{  "statusCode": 400,  "error": "template_derived_value_invalid",  "message": "Некорректная настройка производного значения вопроса"}
401Unauthorized

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

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

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

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

template_not_found: Шаблон не найден

{  "statusCode": 404,  "error": "template_not_found",  "message": "Шаблон не найден"}
451Unavailable For Legal Reasons

Система в режиме readonly. Не удалось проверить лицензию

{  "statusCode": 451,  "error": "backend_license_failed",  "message": "Система в режиме readonly. Не удалось проверить лицензию"}
Пример запроса
curl -X PATCH 'https://org.inspecto.in/api/templates/0' \  -H 'Content-Type: application/json' \  -d '{}'
Пример ответа
{  "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,  "data": {    "pages": [      {        "id": 0,        "title": "string",        "questions": [          {}        ]      }    ],    "response_sets": [      "string"    ],    "conditions": [      "string"    ]  }}