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

Поиск по истории проекта (events/comments)

GET
/projects/{project_id}/history

Авторизация

bearer
headerAuthorizationBearer <token>

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

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

project_id*number

Query-параметры

sort?array<string>
По умолчанию
[  "created_at.desc"]
type?string
По умолчанию"all"
Значения"all""comment""event"
count*number
Диапазонот 1 до 1000
offset*number
Диапазонот 0

Тело ответа

responseapplication/json
count*number
sum*number
offset*number

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

401Unauthorized

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

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

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

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

project_not_found: Проект не найден

{  "statusCode": 404,  "error": "project_not_found",  "message": "Проект не найден"}
Пример запроса
curl -X GET 'https://org.inspecto.in/api/projects/0/history?count=1&offset=0'
Пример ответа
{  "items": [    {      "history_type": "event",      "id": 0,      "user": {        "id": 0,        "first_name": "string",        "last_name": "string",        "patronymic": "string",        "avatar": "string"      },      "type": "create_project",      "key": "string",      "old_value": 0,      "new_value": 0,      "description": "string",      "data": {        "old_value": {},        "new_value": {},        "field": {          "id": 4,          "key": "equipment",          "title": "Оборудование",          "type": "string",          "multiple": true        },        "old_display": "Насос №1",        "new_display": "Задвижка №2",        "old_items": [          {            "value": 12,            "label": "Насос №1"          }        ],        "new_items": [          {            "value": 12,            "label": "Насос №1"          }        ]      },      "created_at": "2019-08-24T14:15:22Z"    }  ],  "count": 0,  "sum": 0,  "offset": 0}