Web API for Datatables: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
Line 59: Line 59:
DELETE /api/uielements
DELETE /api/uielements
</pre>
</pre>
Used to delete dashboards and datatables. Takes as a body an array of objects, with ''id'' and ''type'' (''view'', ''datatable'') properties. Useful when multiple datatables (and also other objects) are deleted.
Used to delete dashboards, models and datatables. Takes as a body an array of objects, with ''id'' and ''type'' (''view'', ''datatable'') properties. Useful when multiple datatables (and also other objects) are deleted.

Revision as of 16:20, 1 November 2020

Datatables API is used to create, delete and edit datatable properties. To import data to datatables, use the importfile method.

Datatable Entity

The datatables API is based on the datatable entity, which has the following properties:

  • id (integer): Datatable id.
  • projectId (integer): Id of the project where the datatable is located. The datatable is moved to another project by changing this property.
  • name (string): Datatable name.
  • description (string): Datatable description.
  • nColumns (integer): Number of columns in the datatable.
  • nRows (integer): Number of rows in the datatable.
  • createdDate (datetime): Datatable creation date.
  • creatorId (integer): Id of the user who created the datatable.
  • lastModifiedDate (datetime): Date when the datatable properties where last modified.
  • lastModifierId (integer): Id of the user who last modified the datatable properties.
  • lastImportedDate (datetime): Date when data was last imported to the datatable.
  • lastImporterId (integer): Id of the user who last time imported data to the datatable.
  • log (string): Modification and import log. Returned only when a separate parameter is specified, otherwise empty.

Only the following properties in datatable objects can be modified: Name, Description and ProjectId.

Methods

The datatables API has the following methods.

GET api/datatables

Gets an array of all datatable entities the user has permissions. Optional query parameter is projectId (integer) which is used to get datatables only from one project.

GET api/datatables/{id}

Returns a datatable entity with given id. Supports optional parameter includeLog (boolean, false by default) to return also the Log property of the datatable. If datatable with given id doesn't exist, not found error is returned. If the current user has no access to the datatable, unauthorized error is returned.

POST api/datatables

Creates a new empty datatable. Takes the datatable entity in the body. Returns the created datatable entity. If current user has no rights to create the datatable, unauthorized error is returned.

PUT api/datatables/{id}

Updates information of an existing datatable with the given id. Takes the datatable properties object in the body. Id property in the datatable entity is ignored. If datatable with given id doesn't exist, not found error is returned. If current user has no rights to modify the datatable, unauthorized error is returned.

DELETE api/datatables/{id}

Deletes a datatable with given id. If datatable with the given id doesn't exist, not found error is returned. If current user has no rights to delete the datatable, unauthorized error is returned.

UI Elements API

The following UI elements API operations support datatables:

POST /api/uielements/setproject/{projectid}

Used to move dashboards and datatables to another project. Takes as a body an array of objects, with id and type (view, datatable) properties. Useful when multiple datatables (and also other objects) are moved between projects.

DELETE /api/uielements

Used to delete dashboards, models and datatables. Takes as a body an array of objects, with id and type (view, datatable) properties. Useful when multiple datatables (and also other objects) are deleted.