Method: reportData.query

Executes an ad-hoc query and returns structured JSON payload data.

HTTP request

POST https://dfareporting.googleapis.com/dfareporting/v5/userprofiles/{profileId}/reportdata/query

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
profileId

string (int64 format)

Required. The Campaign Manager 360 user profile ID.

Request body

The request body contains an instance of ReportDataQueryRequest.

Response body

Represents a response to report data request.

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

JSON representation
{
  "columnHeaders": [
    {
      object (ColumnHeader)
    }
  ],
  "rows": [
    {
      object (ReportDataRow)
    }
  ],
  "totalRow": {
    object (ReportDataRow)
  },
  "nextPageToken": string
}
Fields
columnHeaders[]

object (ColumnHeader)

Output only. Ordered descriptors of the requested column fields.

rows[]

object (ReportDataRow)

Output only. The resulting set of matching data rows.

totalRow

object (ReportDataRow)

Output only. Singular aggregate total row for the entire query matching the criteria. Column headers apply in the exact same order as data rows.

In the totalRow: - All dimension columns contain an empty string (""), as aggregation does not apply. - Non-summable metric columns (e.g. Reach metrics) contain an empty string (""), as grand total aggregation cannot be mathematically/logically computed for them.

nextPageToken

string

Output only. Token to retrieve the next page of rows, or empty if end of results.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/dfareporting

ReportDataQueryRequest

The request body containing ad-hoc query parameters.

JSON representation
{
  "dateRange": {
    object (DateRange)
  },
  "dimensionFilters": [
    {
      object (DimensionValue)
    }
  ],
  "dimensionNames": [
    string
  ],
  "metricNames": [
    string
  ],
  "sortBys": [
    {
      object (SortBy)
    }
  ],
  "maxResults": integer,
  "pageToken": string
}
Fields
dateRange

object (DateRange)

Optional. The requested date range covering the report duration.

dimensionFilters[]

object (DimensionValue)

Optional. The list of dimension values on which report lines are filtered. Utilizes the existing legacy filter message DimensionValue.

dimensionNames[]

string

Optional. The list of dimension names to group by.

metricNames[]

string

Required. The list of metric names to include.

sortBys[]

object (SortBy)

Optional. Sort options across either requested dimensions or metrics.

maxResults

integer

Optional. Maximum number of result rows to return per page. The default value is 100. The maximum allowed value is 1000. Values above 1000 will be coerced (clamped) down to 1000. Negative values will be rejected.

pageToken

string

Optional. Continuation token for paginating results.

SortBy

Specifies the sort configuration for a specific field in the report.

JSON representation
{
  "name": string,
  "sortOrder": enum (SortOrder)
}
Fields
name

string

Required. The dimension or metric field name to sort on.

sortOrder

enum (SortOrder)

Optional. The sort order of this column.

ColumnHeader

A column header in the report.

JSON representation
{
  "name": string,
  "type": enum (ColumnType)
}
Fields
name

string

Output only. The column name.

type

enum (ColumnType)

Output only. The column type.

ColumnType

Enum for column type.

Enums
COLUMN_TYPE_UNSPECIFIED Default value. This value is unused.
DIMENSION Dimension.
METRIC Metric.

ReportDataRow

A row of report data.

JSON representation
{
  "values": [
    string
  ]
}
Fields
values[]

string

Output only. A single sequential list of all cell values matching columnHeaders indices exactly.

  • Metric cells that are suppressed due to Minimum Reporting Standard (MRS) privacy protection constraints return "-".