DataService. Deleting records
Glossary Item Box
General information
The Creatio DataService web service is a RESTfull service. RESTful is a quite simple information management interface that doesn't use any additional internal layers, i.e., the data doesn't need to be converted to any third-party format, such as XML. In a simple RESTful service, each record is uniquely identified by a global identifier such as a URL. Each URL has a strictly specified format. However, this service is not always convenient for transferring large amounts of data.
With the use of the DataService, the data can be automatically configured in various data formats such as XML, JSON, HTML, CSV, and JSV. The data structure is determined by data contracts. A complete list of data contracts used by the DataService, can be found in the "DataService" article.
DeleteQuery data contract
The DeleteQuery contract is used to delete sections. The data is transferred to the DataService via HTTP by using the POST request with the following URL:
// URL format of the POST query to DataService to delete data. http(s)://[Creatio application address]/[Configuration number]/dataservice/[Data fromat]/reply/DeleteQuery // URL example of the POST query to DataService to delete data. http(s)://example.creatio.com/0/dataservice/json/reply/DeleteQuery
The DeleteQuery data contract has a hierarchical structure with multiple nesting levels. In the Creatio application server part, the DeleteQuery data contract is represented by the InsertQuery class of the Terrasoft.Nui.ServiceModel.DataContract namespace of the Terrasoft.Nui.ServiceModel.dll class library. However, for simplicity, the hierarchical structure of the DeleteQuery data contract is conveniently presented as a JSON format object:
{ "RootSchemaName":"[Root schema]", "OperationType":[Record operation type], "ColumnValues":[Column values. Not used.], "Filters":[Query filters] }
The basic properties of the DeleteQuery class and their possible values are presented in table 1.
Table 1. DeleteQuery class properties.
Property | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
RootSchemaName | string | A string containing the name of the root object schema of the added record. | ||||||||||
OperationType | QueryOperationType |
Operation type is set by the QueryOperationType namespace Terrasoft.Nui.ServiceModel.DataContract namespace enumeration value. For the InsertQuery theQueryOperationType.Insert value is set. QueryOperationType enumeration values:
|
||||||||||
ColumnValues | ColumnValues | Contains a collection of column values of the added record. Inherited from the BaseQuery parent class. Not used in this type of queries. | ||||||||||
Filters | Filters | Query filter collection. Its Filter type is defined in the Terrasoft.Nui.ServiceModel.DataContract namespace. |
The Filters class is defined in the Terrasoft.Nui.ServiceModel.DataContract namespace. The properties of this class are described in the "DataService. Data filtering" article.
ATTENTION
IMPORTANT
The DeleteQuery query class instance must contain a link to the correctly initialized Filters class instance in the Filters property. Otherwise ALL section records will be deleted.