This documentation covers a Beta version of the Postmaster API.

Method: domains.trafficStats.list

List traffic statistics for all available days. Returns PERMISSION_DENIED if user does not have permission to access TrafficStats for the domain.

HTTP request

GET https://gmailpostmastertools.googleapis.com/v1beta1/{parent=domains/*}/trafficStats

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

The resource name of the domain whose traffic statistics we'd like to list. It should have the form domains/{domain_name}, where domain_name is the fully qualified domain name.

Query parameters

Parameters
startDate

object (Date)

The earliest day of the metrics to retrieve inclusive. startDate and endDate must both be specified or both left unspecified. If only one is specified, or endDate is earlier in time than startDate, then INVALID_ARGUMENT is returned.

endDate

object (Date)

The most recent day of the metrics to retrieve exclusive. startDate and endDate must both be specified or both left unspecified. If only one is specified, or endDate is earlier in time than startDate, then INVALID_ARGUMENT is returned.

pageSize

integer

Requested page size. Server may return fewer TrafficStats than requested. If unspecified, server will pick an appropriate default.

pageToken

string

The nextPageToken value returned from a previous List request, if any. This is the value of ListTrafficStatsResponse.next_page_token returned from the previous call to trafficStats.list method.

Request body

The request body must be empty.

Response body

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

Response message for trafficStats.list.

JSON representation
{
  "trafficStats": [
    {
      object (TrafficStats)
    }
  ],
  "nextPageToken": string
}
Fields
trafficStats[]

object (TrafficStats)

The list of TrafficStats.

nextPageToken

string

Token to retrieve the next page of results, or empty if there are no more results in the list.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/postmaster.readonly

For more information, see the OAuth 2.0 Overview.

Date

Represents a whole or partial calendar date, e.g. a birthday. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. This can represent:

  • A full date, with non-zero year, month and day values
  • A month and day value, with a zero year, e.g. an anniversary
  • A year on its own, with zero month and day values
  • A year and month value, with a zero day, e.g. a credit card expiration date

Related types are google.type.TimeOfDay and google.protobuf.Timestamp.

JSON representation
{
  "year": integer,
  "month": integer,
  "day": integer
}
Fields
year

integer

Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year.

month

integer

Month of year. Must be from 1 to 12, or 0 if specifying a year without a month and day.

day

integer

Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year and month where the day is not significant.

Try it!