Report settings API
General notes
Embeddable fields
| Name | Type | Description |
|---|---|---|
client | Client | Client of Project's report setting Client. |
projects | Project[] | Projects of report setting Project. |
Content
Report settings collection:
Single report setting:
- [GET] report setting detail
- [STORE] create report setting
- [PUT/PATCH] update report setting
- [DELETE] delete report setting
Report settings collection
Report settings index
This method needs permission
accessonreport-settings
Request
| Index behaviour | Definition |
|---|---|
| Paginated by default | Yes |
| Sorting | id, name, client_id, project_id, type, is_live, one_time_from, one_time_to, regular_start, regular_interval, created_at, is_bug_field_hidden_for_client, is_automatically_created_by_project |
| Filters | id:enum, name:string, client_id:int, project_id:int, type:int, is_live:bool, one_time_from:date, one_time_to:date, regular_start:date, regular_interval:int, created_at:date, updated_at:date, is_bug_field_hidden_for_client:bool, is_automatically_created_by_project:bool |
| Embedded | projects |
GET /api/v0/report-settings HTTP/1.1
Content-Type: application/json
Responses
200 OK
GET /api/v0/report-settings HTTP/1.1
Content-Type: application/json
{
"items": [
{
"id": 11,
"name": "Test live",
"client_id": 1,
"responsible_user_id": 2,
"type": "1",
"is_live": true,
"task_filter": "1",
"is_bug_field_hidden_for_client": false,
"one_time_from": "2022-12-31T23:00:00.000000Z",
"one_time_to": "2023-01-30T23:00:00.000000Z",
"regular_start": null,
"regular_interval": null,
"created_at": "2023-01-11T15:46:49+0100",
"updated_at": "2023-01-11T15:46:49+0100",
"_links": [
{
"href": "/api/v0/report-settings/11",
"rel": "self",
"type": "GET"
}
]
}
]
}
Single report setting
Report setting detail
GET /api/v0/report-settings/{report_setting_id}
This method needs permission
readonreport-settings.
Get ReportSetting detail.
Request
| Index behaviour | Definition |
|---|---|
| Embedded | projects |
Request
GET /api/v0/report-settings/11 HTTP/1.1
Content-Type: application/json
Response
200 OK
GET /api/v0/report-settings/11 HTTP/1.1
Content-Type: application/json
{
"id": 11,
"name": "Test live",
"client_id": 1,
"responsible_user_id": 2,
"type": "1",
"is_live": true,
"task_filter": "1",
"is_bug_field_hidden_for_client": false,
"one_time_from": "2022-12-31T23:00:00.000000Z",
"one_time_to": "2023-01-30T23:00:00.000000Z",
"regular_start": null,
"regular_interval": null,
"created_at": "2023-01-11T15:46:49+0100",
"updated_at": "2023-01-11T15:46:49+0100",
"_links": [
{
"href": "/api/v0/report-settings/11",
"rel": "self",
"type": "GET"
}
]
}
404 NOT FOUND
ReportSetting was not found.
GET /api/v0/report-settings/50 HTTP/1.1
Content-Type: application/json
Status-Code: 404
{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}
Create report setting
POST /api/v0/report-settings
This method needs permission
createonreport-settings.
Method for creating new ReportSetting.
Request
| Param | Type | Description | Requirements |
|---|---|---|---|
name | string | Report setting name | Required. Has to be string. |
client_id | int | Client id | Required. Id of client Client |
project_id | int | Project id | Required. Id of project Project |
responsible_user_id | int | Responsible User id | Required. Id of user User |
type | int | Type of Report setting | Required. Must be enumerator of report_setting_type |
task_filter | int | Task filter of report setting | Required. Must be enumerator of report_setting_task_filter |
one_time_from | date | Date, when report will be generated from | Required if type is one time. |
one_time_to | date | Date, when report will be generated to | Required if type is one time. |
regular_start | date | Date, when regular report will be generated | Required if type is regular. |
regular_interval | int | Report generating interval | Required if type is regular. |
POST /api/v0/report-settings HTTP/1.1
Content-Type: application/json
{
"name": "test",
"client_id": 1,
"project_id": 2,
"project_ids": [2, 4],
"responsible_user_id": 1,
"type": 1,
"is_live": true,
"task_filter": 1,
"one_time_from": "2023-01-01T23:00:00.000000Z"
"one_time_to": "2023-01-30T23:00:00.000000Z",
}
Response
201 CREATED
POST /api/v0/report-settings HTTP/1.1
Content-Type: application/json
{
"id": 1,
"name": "test",
"client_id": 1,
"responsible_user_id": 1,
"type": "1",
"is_live": false,
"task_filter": "1",
"is_bug_field_hidden_for_client": false,
"one_time_from": "2023-01-01T23:00:00.000000Z",
"one_time_to": "2023-01-30T23:00:00.000000Z",
"regular_start": null,
"regular_interval": null,
"created_at": "2023-01-11T15:47:05+0100",
"updated_at": "2023-01-11T15:47:05+0100",
"_links": [
{
"href": "/api/v0/report-settings/1",
"rel": "self",
"type": "GET"
}
]
}
422 UNPROCESSABLE ENTITY
Validation error occurred.
POST /api/v0/report-settings HTTP/1.1
Content-Type: application/json
{
"type" : "ValidationError",
"message" : "The given data was invalid.",
"id" : "fe1b04de-b347-43b5-8118-864c1eefaccf",
"errors": [
{
"field": "name",
"message": "The name field is required."
}
]
}
Update report settings
PUT/PATCH /api/v0/report-settings/{report_setting_id}
This method needs permission
updateonreport-settings.
Method for updating ReportSetting data.
Request
Same inputs and requirements as for POST method.
For PATCH method any field can be omitted.
PUT /api/v0/report-settings/1 HTTP/1.1
Content-Type: application/json
{
"name": "test 2"
}
Response
200 OK
ReportSetting successfully updated.
PUT /api/report-settings/1 HTTP/1.1
Content-Type: application/json
{
"id": 1,
"name": "test",
"client_id": 1,
"responsible_user_id": 1,
"type": "1",
"is_live": false,
"task_filter": "1",
"is_bug_field_hidden_for_client": false,
"one_time_from": "2023-01-01T23:00:00.000000Z",
"one_time_to": "2023-01-30T23:00:00.000000Z",
"regular_start": null,
"regular_interval": null,
"created_at": "2023-01-11T15:47:05+0100",
"updated_at": "2023-01-11T15:47:05+0100",
"_links": [
{
"href": "/api/v0/report-settings/1",
"rel": "self",
"type": "GET"
}
]
}
404 NOT FOUND
ReportSetting was not found.
PUT /api/v0/report-settings/2 HTTP/1.1
Content-Type: application/json
Status-Code: 404
{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}
422 UNPROCESSABLE ENTITY
Validation error occurred.
PUT /api/v0/report-settings HTTP/1.1
Content-Type: application/json
{
"type" : "ValidationError",
"message" : "The given data was invalid.",
"id" : "fe1b04de-b347-43b5-8118-864c1eefaccf",
"errors": [
{
"field": "name",
"message": "The name field is required."
}
]
}
Delete report setting
DELETE /api/v0/report-settings/{report_setting_id}
This method needs permission
deleteonreport-settings.
Method for deleting ReportSetting.
Request
DELETE /api/v0/report-settings/1 HTTP/1.1
Content-Type: application/json
Response
204 NO CONTENT
ReportSetting successfully deleted.
404 NOT FOUND
ReportSetting was not found.
DELETE /api/v0/report-settings/1 HTTP/1.1
Content-Type: application/json
Status-Code: 404
{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}