Request
POST https://www.activityinfo.org/resources/reports
Request body
application/json
object | |||
id | string | required | |
label | string | optional | |
sources | object | optional | |
forms | array[string] | required | |
calculatedTables | array[object] | required | |
id | string | required | |
alias | string | required | |
formula | string | required | |
components | array[object] | required | |
id | string | This component's id. Must be unique within the report | required |
content | string | For components such as SECTION_HEADERS and TEXT, this is their text. | optional |
visible | boolean | True if this component is visible. | required |
type | string | The type of component. Values:
|
required |
analysisType | string | For analysis components, this is the type of analysis. | optional |
position | object | For reports with dashboard layout, this is the components position within the dashboard. | optional |
pageId | string | The id of the page on which this component appears. | required |
x | integer | The zero-based horizontal coordinate of this component within the dashboard page. | required |
y | integer | The zero-based vertical coordinate of this component within the dashboard page. | required |
width | integer | The width of the component, in grid cells. | required |
height | integer | The height of the component, in grid cells. | required |
subtitle | string | The subtitle text of SECTION_HEADERS | optional |
dataUrl | string | For SECTION_HEADERS in a dashboard, a data-url containing the logo. | optional |
visualizationType | string | For pivot analyses, this is the type of visualization. Values:
|
optional |
publish | boolean | optional | |
roleGrants | array[object] | required | |
databaseId | string | required | |
roleId | string | optional | |
permission | string | Values:
|
required |
analyses | array[object] | required | |
id | string | required | |
model | object | required | |
layout | string | Values:
|
optional |
owner | object | optional | |
type | string | Values:
|
required |
id | string | Either the user id or the database id | required |
folderId | string | optional | |
pages | array[object] | required | |
id | string | required | |
label | string | optional |
Successful response
application/json
object | |||
id | string | The id of the report. | required |
ownerType | string | Values:
|
required |
ownerId | string | If this is a personal report, then this the id of the user who owns the report. | optional |
ownerName | string | If this is a personal report, then this is the name of the user who owns the report. | required |
databaseId | string | If this report is part of a database, then this is the id of the database to which it belongs. | optional |
label | string | The human-readable label of this report. | required |
published | boolean | True if this report has been published. | required |
components | array[object] | The list of components in this report. | required |
id | string | This component's id. Must be unique within the report | required |
content | string | For components such as SECTION_HEADERS and TEXT, this is their text. | optional |
visible | boolean | True if this component is visible. | required |
type | string | The type of component. Values:
|
required |
analysisType | string | For analysis components, this is the type of analysis. | optional |
position | object | For reports with dashboard layout, this is the components position within the dashboard. | optional |
pageId | string | The id of the page on which this component appears. | required |
x | integer | The zero-based horizontal coordinate of this component within the dashboard page. | required |
y | integer | The zero-based vertical coordinate of this component within the dashboard page. | required |
width | integer | The width of the component, in grid cells. | required |
height | integer | The height of the component, in grid cells. | required |
subtitle | string | The subtitle text of SECTION_HEADERS | optional |
dataUrl | string | For SECTION_HEADERS in a dashboard, a data-url containing the logo. | optional |
visualizationType | string | For pivot analyses, this is the type of visualization. Values:
|
optional |
layout | string | The layout of this report's components. Values:
|
required |
icon | string | The icon to use when listing this report. | required |
sources | object | The data sources that are included in this report. | required |
forms | array[string] | required | |
calculatedTables | array[object] | required | |
id | string | required | |
alias | string | required | |
formula | string | required | |
editType | string | Values:
|
required |
pages | array[object] | For reports with DASHBOARD layout, the list of pages. | required |
id | string | required | |
label | string | optional |
Error responses
Status Code | Error Code | Description |
---|---|---|
400 | DATABASE_ |
The database specified in a {@link ReportRoleGrant} cannot be found. |
400 | DATABASE_ |
The database specified in a {@link ReportOwnerUpdate} cannot be found. |
400 | ID_ |
The ResourceId in {@link org.activityinfo.model.database.DatabaseTree} is not a report type. |
400 | MISSING_ |
A report cannot be added without a component |
400 | MISSING_ |
A report cannot be added without a label |
400 | MISSING_ |
A report cannot be added without a label |
400 | MISSING_ |
A report cannot be added without specifying an owner |
400 | MISSING_ |
A dashboard report cannot be added without a page |
400 | MISSING_ |
A report cannot be added without a data source |
400 | ROLE_ |
the role specified in a {@link ReportRoleGrant} cannot be found. |
400 | SINGLE_ |
The 'single' report layout requires a single analysis component. |
401 | AUTHENTICATION_ |
The request must be authenticated |
403 | PERMISSION_ |
You do not have permission to update this report |
403 | PUBLISHING_ |
You do not have permission to publish a report that includes the given form or database. |
403 | ROLE_ |
You do not have permission to share this report with the given database role. |
403 | USER_ |
The user id specified in {@link ReportOwnerUpdate} doesn't match authenticated user. |
404 | DATABASE_ |
The database specified in a {@link Report} cannot be found. |