Run SQL Interface Query

Version 4.0.24.18 (latest)

Run a saved SQL interface query.

This runs a previously created SQL interface query.

The 'result_format' parameter specifies the desired structure and format of the response.

Supported formats:

result_format Description
json_bi Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query

Request

GET /sql_interface_queries/{query_id}/run/{result_format}
Datatype
Description
Request
HTTP Request
path
HTTP Path
Expand HTTP Path definition...
query_id
integer
Integer id of query
result_format
string
Format of result, options are: ["json_bi"]

Response

200: Query Result

Datatype
Description
(object)
metadata
Metadata about the query
Expand JsonBiMetadata definition...
big_query_metadata
Metadata returned from Bigquery. Null if any other dialect.
Expand JsonBiBigQueryMetadata definition...
total_bytes_processed
integer
Total bytes processed by the BigQuery job
backend_cache_hit
boolean
Return whether or not query results were served from the BigQuery cache.
fields
Fields
Expand JsonBiFields definition...
dimensions
measures
pivots
table_calculations
pivots
Expand JsonBiPivots definition...
key
string
Pivot Column Value
data
object
Pivot Data
sort_values
object
Pivot Sort Values
is_total
boolean
If the value is a total
has_subtotals
boolean
If the query has subtotals
has_totals
boolean
If the query has totals
columns_truncated
string
If the query results hit the maximum column limit and additional columns were truncated
filter_expression
string
Filter expression applied to the query results
filters
object
Filters applied to the query results
sql
string
Raw sql query. Null if user does not have permission to view sql
rows
string[]

400: Bad Request

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

403: Permission Denied

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

404: Not Found

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link

422: Validation Error

Datatype
Description
(object)
message
string
Error details
Expand ValidationErrorDetail definition...
field
string
Field with error
code
string
Error code
message
string
Error info message
documentation_url
string
Documentation link
documentation_url
string
Documentation link

429: Too Many Requests

Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link