Run SQL Interface Query

Version 4.0.25.2 (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
query_id
integer
Integer id of query
result_format
string
Format of result, options are: ["json_bi"]

Response

Datatype
Description
(object)
metadata
Metadata about the query
big_query_metadata
Metadata returned from Bigquery. Null if any other dialect.
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
dimensions
measures
pivots
table_calculations
pivots
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[]
Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link
Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link
Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link
Datatype
Description
(object)
message
string
Error details
field
string
Field with error
code
string
Error code
message
string
Error info message
documentation_url
string
Documentation link
documentation_url
string
Documentation link
Datatype
Description
(object)
message
string
Error details
documentation_url
string
Documentation link