Version 4.0.24.14
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 | Plain json |
json_bi | (RECOMMENDED) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query |
json_detail | (LEGACY) Row data plus metadata describing the fields, pivots, table calcs, and other aspects of the query |
csv | Comma separated values with a header |
txt | Tab separated values with a header |
html | Simple html |
md | Simple markdown |
xlsx | MS Excel spreadsheet |
sql | Returns the generated SQL rather than running the query |
Request
GET
/sql_interface_queries/{query_id}/run/{result_format}
Datatype
Description
Request
path
Expand HTTP Path definition...
query_id
Integer id of query
result_format
Format of result, options are: ["json_bi"]
Response
200: Query Formats
Datatype
Description
(object)
json_bi
lock
Expand JsonBi definition...
metadata
lock
Metadata about the query
Expand JsonBiMetadata definition...
big_query_metadata
lock
Metadata returned from Bigquery. Null if any other dialect.
fields
lock
Fields
pivots
has_subtotals
lock
If the query has subtotals
has_totals
lock
If the query has totals
columns_truncated
lock
If the query results hit the maximum column limit and additional columns were truncated
filter_expression
lock
Filter expression applied to the query results
filters
lock
Filters applied to the query results
sql
lock
Raw sql query. Null if user does not have permission to view sql
rows
json
lock
json_detail
lock
csv
lock
txt
lock
html
lock
md
lock
xlsx
lock
sql
lock
400: Bad Request
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
403: Permission Denied
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
404: Not Found
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link
422: Validation Error
Datatype
Description
(object)
message
lock
Error details
errors
Expand ValidationErrorDetail definition...
field
lock
Field with error
code
lock
Error code
message
lock
Error info message
documentation_url
lock
Documentation link
documentation_url
lock
Documentation link
429: Too Many Requests
Datatype
Description
(object)
message
lock
Error details
documentation_url
lock
Documentation link