1

I need to use Gmail Postmaster Tools API, but in google documentation I don't find it that useful. I am facing issue in finding out which API key to use and what credentials to create, like Service Account or OAuth 2. I want to test it locally. Here is the curl command I am using:

curl   'https://gmailpostmastertools.googleapis.com/v1beta1/domains/www.example.com/trafficStats/20200705?access_token=[ACCESS_TOKEN]'   --header 'Accept: application/json'   --compressed

Response:

{
  "error": {
    "code": 403,
    "message": "The caller does not have permission",
    "status": "PERMISSION_DENIED"
  }
}
flixy
  • 73
  • 2
  • 10
  • 1
    Yes, I have already set up domain wide delegation @DaImTo – flixy Jul 07 '20 at 07:54
  • From Try It! Web page of developers.google.com and also I am using this library "https://github.com/google/oauth2l" to get access token. @DaImTo – flixy Jul 07 '20 at 08:36

1 Answers1

0

Well it turns out that my domain was not verified with my google account. When I added DNS record than it started working.

flixy
  • 73
  • 2
  • 10