Web API for Dashboards: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
Dashboards API is used to create dashboards, delete dashboards and edit dashboards properties.
Dashboards API provides functions for accessing dashboard objects: finding dashboards by identifier path, getting a dashboard by id, creating dashboards, and modifying existing dashboards.


Note that the [[Web API for Workspace Elements|Workspace Elements API]] supports also dashboards.
Note that the [[Web API for Workspace Elements|Workspace Elements API]] also operates on dashboards as UiElements of type ''View''. Dashboard deletion is handled through the Workspace Elements API.


==Methods==
==Methods==
The dashboards API has the following methods.
The dashboards API has the following methods.


=== Get dashboard by identifier===
<pre>
<pre>
GET api/dashboards
GET api/dashboards?identifierPath={identifierPath}&includeProjectPath={includeProjectPath}&projectId={projectId}
</pre>
</pre>
Gets a list of all dashboards in the system (if no parameter is provided). Supports optional query parameter ''projectId'' which is project id where to get dashboards from.
Gets a list of dashboard objects accessible to the current user matching the specified ''identifierPath''.


The ''includeProjectPath'' query parameter is optional and defaults to ''true''. When it is ''true'', returns also the project path where the dashboard is located.
The ''projectId'' query parameter is optional. If it is specified and ''identifierPath'' is a relative path, only dashboards belonging to that project are returned.
=== Get dashboard by ID ===
<pre>
<pre>
GET api/dashboards/{id}
GET api/dashboards/{dashboardId}
</pre>
</pre>
Gets a dashboard entity by the dashboard id. If dashboard doesn't exist, not found error is returned. If current user has no access to the dashboard, unauthorized error is returned.
Gets a dashboard object by ID. The ''dashboardId'' is the database IDof the dashboard.


The returned Dashboard object's ''Views'' property contains only dashboards identified by ''dashboardId''.
=== Get dashboards in project ===
<pre>
<pre>
POST api/dashboards
POST api/dashboards/?projectId={projectId}
</pre>
</pre>
Creates a new empty dashboard. Takes the dashboard entity in the body (read-only properties are ignored). Returns the created dashboard entity. If current user has no rights to create dashboard, unauthorized error is returned.
Creates a new dashboard in the database. The request body is a Dashboard object. The ''projectId'' query parameter specifies the project into which the dashboard is created.


<pre>
Returns a dashboard creation result object, not the created Dashboard object. The result contains the saved dashboard's ''Id'' and''Name''.
PUT api/dashboards/{id}
</pre>
Updates properties of an existing dashboard with the given id. If dashboard doesn't exist, not found error is returned. If current user has no rights to modify the dashboard, unauthorized error is returned.


=== Modify dashboard ===
<pre>
<pre>
DELETE api/dashboards/{id}
PUT api/dashboards/{dashboardId}
</pre>
</pre>
Deletes a dashboard with given id. If the dashboard doesn't exist, not found error is returned. If current user has no rights to delete the dashboard, unauthorized error is returned.
Modifies an existing dashboard in the database. The request body is a Dashboard object. The method does not return content.


[[Category: QPR ProcessAnalyzer]]
When a dashboard is saved, the relevant dashboard is the first item in the dashboard object's ''Views'' property. For an existing element, the saved properties include ''Name'', ''Description'', and ''Identifier''.

Latest revision as of 21:03, 8 June 2026

Dashboards API provides functions for accessing dashboard objects: finding dashboards by identifier path, getting a dashboard by id, creating dashboards, and modifying existing dashboards.

Note that the Workspace Elements API also operates on dashboards as UiElements of type View. Dashboard deletion is handled through the Workspace Elements API.

Methods

The dashboards API has the following methods.

Get dashboard by identifier

GET api/dashboards?identifierPath={identifierPath}&includeProjectPath={includeProjectPath}&projectId={projectId}

Gets a list of dashboard objects accessible to the current user matching the specified identifierPath.

The includeProjectPath query parameter is optional and defaults to true. When it is true, returns also the project path where the dashboard is located.

The projectId query parameter is optional. If it is specified and identifierPath is a relative path, only dashboards belonging to that project are returned.

Get dashboard by ID

GET api/dashboards/{dashboardId}

Gets a dashboard object by ID. The dashboardId is the database IDof the dashboard.

The returned Dashboard object's Views property contains only dashboards identified by dashboardId.

Get dashboards in project

POST api/dashboards/?projectId={projectId}

Creates a new dashboard in the database. The request body is a Dashboard object. The projectId query parameter specifies the project into which the dashboard is created.

Returns a dashboard creation result object, not the created Dashboard object. The result contains the saved dashboard's Id andName.

Modify dashboard

PUT api/dashboards/{dashboardId}

Modifies an existing dashboard in the database. The request body is a Dashboard object. The method does not return content.

When a dashboard is saved, the relevant dashboard is the first item in the dashboard object's Views property. For an existing element, the saved properties include Name, Description, and Identifier.