Version 4.0.26.22 (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) [JsonBi](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/JsonBi) metadata [JsonBiMetadata](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/JsonBiMetadata) Metadata about the query Expand JsonBiMetadata definition... big_query_metadata [JsonBiBigQueryMetadata](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/JsonBiBigQueryMetadata) 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 [JsonBiFields](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/JsonBiFields) Fields Expand JsonBiFields definition... dimensions [JsonBiField](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/JsonBiField)\[\] measures [JsonBiField](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/JsonBiField)\[\] pivots [JsonBiField](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/JsonBiField)\[\] table_calculations [JsonBiTableCalc](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/JsonBiTableCalc)\[\] pivots [JsonBiPivots](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/JsonBiPivots)\[\] 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) [Error](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/Error) message string Error details documentation_url string Documentation link

### 403: Permission Denied

Datatype Description (object) [Error](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/Error) message string Error details documentation_url string Documentation link

### 404: Not Found

Datatype Description (object) [Error](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/Error) message string Error details documentation_url string Documentation link

### 422: Validation Error

Datatype Description (object) [ValidationError](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/ValidationError) message string Error details errors [ValidationErrorDetail](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/ValidationErrorDetail)\[\] 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) [Error](https://docs.cloud.google.com/looker/docs/reference/looker-api/latest/types/Error) message string Error details documentation_url string Documentation link