Query

Get query

GET
Get query including paginated results if the query execution is complete

Path parameters

query_idstringRequired
The unique identifier for the query

Query parameters

offsetintegerOptional
Starting index to return in the results
limitintegerOptional
Max number of items to return in the results
exclude_resultsbooleanOptional
Optionally exclude results from the response

Response

This endpoint returns an object
createdUserId
string
The user that created the resource
createdDt
datetime
The created datetime of the resource
updatedUserId
string
The user that last updated the resource
updatedDt
datetime
The datetime the resource was last updated
queryId
string
The query id
query
string
The SQL query
datasetId
string
The dataset id
status
enum
The current status of the query
startDt
datetimeOptional
The time the query started executing
endDt
datetimeOptional
The time the query finished executing
isActive
booleanOptional
Defines if the query is in an active state or not
result
objectOptional
The result of the query
GET
$curl https://app.coactive.ai/api/v1/queries/string \
> -H "Authorization: Bearer <token>"
Response
1{
2 "createdUserId": "user_example",
3 "createdDt": "2018-09-11T15:11:45.456777",
4 "updatedUserId": "user_example",
5 "updatedDt": "2018-09-11T15:11:45.456777",
6 "queryId": "57552f03-87af-4847-a83e-e46a320af0c2",
7 "query": "select * from coactive_images_table",
8 "datasetId": "c40276f0-024b-4a3f-b3e6-dcf0d304843e",
9 "status": "Running",
10 "startDt": "2018-09-11T15:11:45.456777",
11 "endDt": "2018-09-11T15:11:48.456777",
12 "isActive": false,
13 "result": {
14 "error": "Error raised while executing query",
15 "meta": {
16 "page": {
17 "currentPage": 1,
18 "limit": 10,
19 "offset": 0,
20 "lastPage": 1,
21 "total": 100
22 },
23 "links": {
24 "next": "/api/list?limit=10&offset=10",
25 "first": "/api/list?limit=10&offset=0",
26 "last": "/api/list?limit=10&offset=90"
27 },
28 "sort": [
29 {
30 "direction": "asc",
31 "field": "name"
32 }
33 ]
34 },
35 "data": []
36 }
37}