- [HTTP request](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/query#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/query#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/query#body.request_body)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/query#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/query#body.response_body)
  - [JSON representation](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/query#body.QueryReportTaskResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/query#body.aspect)
- [Try it!](https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/properties.reportTasks/query#try-it)

Retrieves a report task's content. After requesting the `reportTasks.create`, you are able to retrieve the report content once the report is ACTIVE. This method will return an error if the report task's state is not `ACTIVE`. A query response will return the tabular row \& column values of the report.

### HTTP request

`POST https://analyticsdata.googleapis.com/v1alpha/{name=properties/*/reportTasks/*}:query`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The report source name. Format: `properties/{property}/reportTasks/{report}` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "offset": string, "limit": string } ``` |

| Fields ||
|---|---|
| `offset` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The row count of the start row in the report. The first row is counted as row 0. When paging, the first request does not specify offset; or equivalently, sets offset to 0; the first request returns the first `limit` of rows. The second request sets offset to the `limit` of the first request; the second request returns the second `limit` of rows. To learn more about this pagination parameter, see [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). |
| `limit` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The number of rows to return from the report. If unspecified, 10,000 rows are returned. The API returns a maximum of 250,000 rows per request, no matter how many you ask for. `limit` must be positive. The API can also return fewer rows than the requested `limit`, if there aren't as many dimension values as the `limit`. The number of rows available to a QueryReportTaskRequest is further limited by the limit of the associated ReportTask. A query can retrieve at most ReportTask.limit rows. For example, if the ReportTask has a limit of 1,000, then a reportTasks.query request with offset=900 and limit=500 will return at most 100 rows. To learn more about this pagination parameter, see [Pagination](https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). |

### Response body

The report content corresponding to a report task.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "dimensionHeaders": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/DimensionHeader`) } ], "metricHeaders": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/MetricHeader`) } ], "rows": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/Row`) } ], "totals": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/Row`) } ], "maximums": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/Row`) } ], "minimums": [ { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/Row`) } ], "rowCount": integer, "metadata": { object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/ResponseMetaData`) } } ``` |

| Fields ||
|---|---|
| `dimensionHeaders[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/DimensionHeader`)`` Describes dimension columns. The number of DimensionHeaders and ordering of DimensionHeaders matches the dimensions present in rows. |
| `metricHeaders[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/MetricHeader`)`` Describes metric columns. The number of MetricHeaders and ordering of MetricHeaders matches the metrics present in rows. |
| `rows[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/Row`)`` Rows of dimension value combinations and metric values in the report. |
| `totals[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/Row`)`` If requested, the totaled values of metrics. |
| `maximums[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/Row`)`` If requested, the maximum values of metrics. |
| `minimums[]` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/Row`)`` If requested, the minimum values of metrics. |
| `rowCount` | `integer` The total number of rows in the query result. |
| `metadata` | ``object (`https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/ResponseMetaData`)`` Metadata for the report. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/analytics.readonly`
- `https://www.googleapis.com/auth/analytics`