Web API for Scripts
Scripts API is used to create, delete and edit script properties.
Note that the Workspace Elements API supports also scripts.
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 scripts API has the following methods.
Start script run
GET api/scripts/run/{scriptId}
Starts a run of the script with given id. Returns id of the started script run operation. Returns immediately without waiting for a script run to be finished. Returns 0 if the script is already running. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script.
Ends script run
GET api/scripts/end/{scriptId}
Terminates a run of the script with given id. Returns id of the terminated script run operation. Returns immediately without waiting for a script run to be aborted. Returns 0 if the script is not running. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script.
Current run log
GET api/scripts/runlog/current/{scriptId}
Gets the current run log of the script with given id, i.e. a run that is currently in progress. Returns the object with the following fields: Log, Exceptions, AdditionalData, OperationId. Returns null if the script is not running. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script.
Last run log
GET api/scripts/runlog/last/{scriptId}
Gets the last completed run log of the script with given id. Returns the object with the following fields: Log, Exceptions, AdditionalData, OperationId. Returns null if the script is has never been run yet. Requires the global RunScript permission. Returns NotFound if a script does not exist, or Forbidden if current user has no access to the script.