Web API for Datatables

From QPR ProcessAnalyzer Wiki
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.

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.
  • 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.
  • NColumns (integer): Number of columns in the datatable.
  • NRows (integer): Number of rows in 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

GET api/datatables

Gets list of all datatables the user has permissions, except datatables that are in the recycle bin. Optional query parameter is projectId (integer) to get datatables from. Returns array of datatable objects.

GET api/datatables/{id}

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

POST api/datatables

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

PUT api/datatables/{id}

Updates information of the existing datatable with the given id. Takes the datatable properties object in the body. 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 the datatable with given id. If datatable with 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 also support datatables:

POST /api/uielements/setproject/{projectid}

Supports also datatable objects. Will be used when multiple datatables (and also other objects) are moved between projects.

DELETE /qprpa/api/uielements

Supports also datatable objects. Will be used when multiple datatables (and also other objects) are deleted.