Views
Возвращает коллекцию представлений. Коллекция может быть отфильтрована с помощью параметров запроса аналогично тому, как фильтруются рабочие пакеты.
JSON с указанием условий фильтрации. В настоящее время поддерживаются следующие фильтры:
-
project: фильтрует представления по проекту, которому назначен соответствующий запрос. Если фильтр проекта задан с помощью оператора
!*(не любого), возвращаются глобальные представления. -
id: фильтрует представления на основе их идентификатора
-
тип: фильтрует просмотры в зависимости от их типа
[{ "project_id": { "operator": "!*", "values": null }" }]OK
GET /op/api/v3/views HTTP/1.1
Host: example.u-meteor.ru
Authorization: Basic username:password
Accept: */*
OK
{
"_links": {
"self": {
"href": "/api/v3/views"
},
"changeSize": {
"href": "/api/v3/views?pageSize={size}",
"templated": true
},
"jumpTo": {
"href": "/api/v3/views?offset={offset}",
"templated": true
}
},
"total": 1,
"count": 1,
"_type": "Collection",
"_embedded": {
"elements": [
{
"_type": "Views::WorkPackagesTable",
"name": "Current work packages",
"timelineVisible": true,
"id": 9,
"_links": {
"self": {
"href": "/api/v3/views/9"
},
"query": {
"href": "/api/v3/queries/18",
"title": "A query"
},
"columns": [
{
"href": "/api/v3/users/id",
"title": "ID"
},
{
"href": "/api/v3/users/subject",
"title": "Subject"
},
{
"href": "/api/v3/users/type",
"title": "Type"
},
{
"href": "/api/v3/users/status",
"title": "Status"
},
{
"href": "/api/v3/users/priority",
"title": "Priority"
},
{
"href": "/api/v3/users/assignee",
"title": "Assignee"
},
{
"href": "/api/v3/users/updated_at",
"title": "Updated on"
}
],
"project": {
"href": "/api/v3/project/89",
"title": "The project"
}
}
}
]
}
}Идентификатор просмотра
42Returns the result of a single view, dependent of the view type.
Occurs when the client did not send a valid JSON object in the request body.
Returned if the client does not have sufficient permissions.
Required permission: The required permission depends on the type of the view.
Returned if the resource can not be found.
Note: A client without sufficient permissions shall not be able to test for the existence of a view. That's why a 404 is returned here, even if a 403 might be more appropriate.
GET /op/api/v3/views/{id} HTTP/1.1
Host: example.u-meteor.ru
Authorization: Basic username:password
Accept: */*
{
"_type": "Views::WorkPackagesTable",
"name": "Current work packages",
"id": 9,
"_links": {
"self": {
"href": "/api/v3/views/9"
},
"query": {
"href": "/api/v3/queries/18",
"title": "Current work packages"
},
"project": {
"href": "/api/v3/project/89",
"title": "The project"
}
}
}При вызове этой конечной точки клиент предоставляет один объект, содержащий, по крайней мере, необходимые свойства и ссылки в теле. Необходимые поля представления можно найти в его схеме, которая встроена в соответствующую форму. Обратите внимание, что разрешено предоставлять только свойства или ссылки, поддерживающие операцию записи.
Существуют различные подтипы Views (например, Views::WorkPackagesTable), каждый из которых имеет свою собственную
конечную точку для создания этого подтипа, например
/api/v3/views/work_packages_tableдляViews::WorkPackagesTable/api/v3/views/team_plannerдляViews::TeamPlanner/api/v3/views/work_packages_calendarдляViews::WorkPackagesCalendar
Еще не реализовано Чтобы получить список доступных подтипов и, следовательно, конечные точки для создания подтипа, используйте
/api/v3/views/schemas
конечная точка.
Идентификатор представления
1Created
Occurs when the client did not send a valid JSON object in the request body.
Occurs when the client did not send a Content-Type header
Occurs when the client sends an unsupported Content-Type header.
Returned if:
-
the client tries to modify a read-only property (
PropertyIsReadOnly) -
a constraint for a property was violated (
PropertyConstraintViolation) -
the client provides a link to an invalid resource (
ResourceTypeMismatch), e.g. a query not found
POST /op/api/v3/views/{id} HTTP/1.1
Host: example.u-meteor.ru
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 49
{
"_links": {
"query": {
"href": "/api/v3/queries/5"
}
}
}{
"_type": "Views::WorkPackagesTable",
"name": "Current work packages",
"id": 9,
"_links": {
"self": {
"href": "/api/v3/views/9"
},
"query": {
"href": "/api/v3/queries/18",
"title": "Current work packages"
},
"project": {
"href": "/api/v3/project/89",
"title": "The project"
}
}
}