Web API for Datatables

From QPR ProcessAnalyzer Wiki
Revision as of 19:24, 12 December 2020 by Ollvihe (talk | contribs) (→‎Methods)
Jump to navigation Jump to search

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

Note that the Workspace Elements API supports also datatables.

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.

List datatables

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 datatable

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.

Create datatable

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.

Edit datatable

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 datatable

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.

Copy datatable

POST api/datatables/copy/{id}

Creates a copy of a datatable with the data. Copying the data is done in the background after the operation has returned. Takes the copied datatable properties in the body. Returns the created datatable id and operation id of the copy operatation.