Retrieves a list of domain statistics for a given domain and time period. Returns PERMISSION_DENIED if you don't have permission to access DomainStats for the domain.
HTTP request
POST https://gmailpostmastertools.googleapis.com/v2beta/{parent=domains/*}/domainStats:query
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
parent |
Required. The parent resource name where the stats are queried. Format: domains/{domain} |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ "metricDefinitions": [ { object ( |
| Fields | |
|---|---|
metricDefinitions[] |
Required. The specific metrics to query. You can define a custom name for each metric, which will be used in the response. |
timeQuery |
Required. The time range or specific dates for which to retrieve the metrics. |
pageSize |
Optional. The maximum number of DomainStats resources to return in the response. The server may return fewer than this value. If unspecified, a default value of 10 will be used. The maximum value is 200. |
pageToken |
Optional. The nextPageToken value returned from a previous List request, if any. If the aggregation granularity is DAILY, the page token will be the encoded date + "/" + metric name. If the aggregation granularity is OVERALL, the page token will be the encoded metric name. |
aggregationGranularity |
Optional. The granularity at which to aggregate the statistics. If unspecified, defaults to DAILY. |
Response body
If successful, the response body contains an instance of QueryDomainStatsResponse.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/postmasterhttps://www.googleapis.com/auth/postmaster.traffic.readonly
For more information, see the Authorization guide.