Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Get Results Sql Query

GET/api/v2/sqlQueries/{sqlQueryId}/getResults
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Gets the results of a query. The results of the query are returned in the Apache Arrow format.

This endpoint implements long polling and requests will time out after one minute. They can be safely retried while the query is still running.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:sql-queries-read.

Path parameters

sqlQueryId
string

The id of a query.

Query parameters

preview
boolean
optional

Enables the use of preview functionality.

Response body

body
string

Examples

Request

Copied!
1 2 3 curl \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/sqlQueries/OikKBfqBaWRjOGQ3YTJkNzMtYjhiZi00ZDMzLTlkOWMtOGQzOW/getResults?preview=true"

Error responses

Error Name
QueryCanceledError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe query was canceled.
ParametersqueryId
QueryFailedError CodeINTERNAL
Status Code500
DescriptionThe query failed.
ParametersqueryId, errorMessage
QueryParseErrorError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe query cannot be parsed.
ParameterserrorMessage
QueryRunningError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe query is running.
ParametersqueryId
ReadQueryInputsPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionThe provided token does not have permission to access the inputs to the query.
Parametersrids
QueryPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionThe provided token does not have permission to access the given query.
ParametersqueryId
GetResultsSqlQueryPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionCould not getResults the SqlQuery.
ParameterssqlQueryId