I am writing an integration with Google Postmaster, but have run into an unexpected issue; a domain I am querying against for traffic stats for a specific timestamp is returning a status code 400, with a message of "Request contains an invalid argument".
The domain in question is pulled from the Google Postmaster get domains list endpoint, so I'm confident it's not a simple typo. The request format works for the other domains from that list. The failing domain has data viewable within Postmaster UI. The error is consistent when executing the request via cURL or with Google's Java Postmaster API.
Example input/output of passing domain (with the sensitive info garbaged)
curl --location --request GET 'https://gmailpostmastertools.googleapis.com/v1beta1/domains/foobar.com/trafficStats/20210118' \
--header 'Authorization: Bearer abcdef'
{
"name": "domains/foobar.com/trafficStats/20210118",
"ipReputations": [
{
"reputation": "BAD"
},
{
"reputation": "LOW"
},
{
"reputation": "MEDIUM"
},
{
"reputation": "HIGH",
"sampleIps": [
"127.0.0.1"
],
"ipCount": "1"
}
],
"domainReputation": "HIGH",
"spfSuccessRatio": 1,
"dkimSuccessRatio": 1,
"dmarcSuccessRatio": 1,
"inboundEncryptionRatio": 1,
"deliveryErrors": [
{
"errorClass": "TEMPORARY_ERROR",
"errorType": "SUSPECTED_SPAM"
}
]
}
Example input/output of failing domain (with the sensitive info garbaged)
curl --location --request GET 'https://gmailpostmastertools.googleapis.com/v1beta1/domains/foobar.com/trafficStats/20210118' \
--header 'Authorization: Bearer abcdef'
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}