Reputation: 392
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"
}
}
Upvotes: 1
Views: 423
Reputation: 1
From my experience, assuming your GET request is formatted correctly, error 400 with message "Request contains an invalid argument." just means there is no data for that specific date.
You mentioned that:
The failing domain has data viewable within Postmaster UI.
However, did you verify that the failing domain has data specifically on the date that you passed to the API?
Unfortunately, I have not been able to find any official documentation on the actual meaning of this error. Anyone who has more authoritative info is welcome to comment.
Upvotes: 0