Creates a new SQL query for execution. Returns a query ID that can be used to check its execution status.
Query Created
Bad request
Unauthorized
Internal server error
{- "query": "SELECT * FROM devices WHERE state = 'PROVISIONED'",
- "is_download": false,
- "row_limit": 1000,
- "latest_data": false
}{- "content": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
- "query": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "is_download": true,
- "row_limit": 0,
- "latest_data": true,
- "status": "PENDING",
- "result": { }
}
}Returns the current status of a query and its results if available.
Query Status
Bad request
Unauthorized
Query not found
Internal server error
{- "content": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
- "query": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "is_download": true,
- "row_limit": 0,
- "latest_data": true,
- "status": "PENDING",
- "result": {
- "schema": {
- "column_count": 0,
- "columns": [
- {
- "name": "string",
- "position": 0,
- "type_name": "string",
- "type_text": "string"
}
]
}, - "data_array": [
- [
- "string"
]
], - "truncated": true
}, - "error_message": "string"
}
}