Query the data for a list of tables
post
/data/rest/{version}dataservice/runquery
The result contains the data from specified tables with specified columns. In valid columns is ignored. There are two extra sections in the result: pagination information and timestamp for next incremental query.
Request
Supported Media Types
- application/json
The query in json format
Root Schema : QueryObject
Type:
object
The query object for restful service
Show Source
-
name(optional):
string
An optional query name
-
nextKey(optional):
string
Allowed Values:
[ "The value comes from last query when there is more data on server" ]
When there is more data on server, the result from last query returns nextKey property. -
nextTableName(optional):
string
Allowed Values:
[ "The value comes from last query when there is more data on server" ]
When there is more data on server, the result from last query returns nextTableName property. A value "-1" indicates no more data on server -
pageSize(optional):
string
Allowed Values:
[ "1 - 10000" ]
Specifies how many rows returned from this query -
sinceDate(optional):
string
Allowed Values:
[ "The value should either be null or returned from last query" ]
A database date that the query fetches rows created/updated after it -
tables:
array tables
A list of queries for tables
Nested Schema : tables
Type:
array
A list of queries for tables
Show Source
Example:
"tables": [ { "tableName": "Activity", "columns": [ "ACTIVITY_ID", "Name", "ACTIVITY_TYPE", "STATUS", "START_DATE", "Finish" ], "condition": { "operator": "AND", "conditions": [ { "columnName": "Planned Duration", "operator": "GREATER_THAN_OR_EQUALS", "value1": "1200" }, { "columnName": "PROJ_ID", "operator": "EQUALS", "value1": "1" } ] } } ]
Nested Schema : TableQuery
Type:
Show Source
object
-
columns:
array columns
A comma separated list of columns of the query
-
condition(optional):
object The criteria of the query
-
joinedTables(optional):
array joinedTables
Joined tables
-
tableName:
string
The from table name of the query
Nested Schema : The criteria of the query
Type:
Show Source
object
-
columnName(optional):
string
The column name. This property is ignored when the operator is AND/OR.
-
conditions(optional):
array conditions
List of Conditions if the operator is AND/OR.
-
operator(optional):
string
Allowed Values:
[ "AND", "OR", "IS_NULL", "IS_NOT_NULL", "EQUALS", "NOT_EQUALS", "GREATER_THAN", "LESS_THAN", "GREATER_THAN_OR_EQUALS", "LESS_THAN_OR_EQUALS", "BETWEEN" ]
The condition operator -
value1(optional):
string
The first value of the criteria. When the operator is AND/OR/IS_NULL/IS_NOT_NULL, this property is ignored.
-
value2(optional):
string
The second value of the criteria. This property is used only when the operator is BETWEEN.
Response
Supported Media Types
- application/json
200 Response
successful operation
Root Schema : DataObject
Type:
object
the result data model
Show Source
-
data(optional):
object data
Additional Properties Allowed: additionalPropertiesA list of tables, which contains rows of column data. It also returns a database date for next query to retrieve fresh data only. If next query only cares about the data being created/updated after current query, it whould supply sinceDate property from current query in the next query. A pagination section is also returned in the response to indicate if there is more data on the server. When nextTableName="-1", no more data available. The next query should use original query PLUS pagination information to retrieve the remaining data on server.
Nested Schema : data
Type:
object
Additional Properties Allowed
Show Source
A list of tables, which contains rows of column data. It also returns a database date for next query to retrieve fresh data only. If next query only cares about the data being created/updated after current query, it whould supply sinceDate property from current query in the next query.
A pagination section is also returned in the response to indicate if there is more data on the server. When nextTableName="-1", no more data available.
The next query should use original query PLUS pagination information to retrieve the remaining data on server.
Nested Schema : additionalProperties
Type:
Show Source
array
-
Array of:
object items
Additional Properties Allowed: additionalProperties
403 Response
You do not have access to the resource.
404 Response
Invalid query