Permission Denied

22 views
Skip to first unread message

Scott Brown

unread,
Jun 5, 2024, 12:32:29 PMJun 5
to AdSense API Forum
Hi,

I have enabled Adsense Management API.  

I have an OAuth 2.0 Client ID for Postman (I have a different one for https://www.googleapis.com/auth/adwords that is working).

I can request new OAuth for scope "https://www.googleapis.com/auth/adsense" and that works.

Yet when I try:

https://adsense.googleapis.com/v2/accounts/account_id/adclients/pub-#####/adunits

Grabbing pub-###### from our Adsense Account info as Publisher ID


I get

{
  "error": {
    "code": 403,
    "message": "The caller does not have permission",
    "status": "PERMISSION_DENIED"
  }
}

Also seeing 100 errors on the API Services page for the Adsense Management API.

Both my Adsense and Google Cloud /API accounts use the same email / login.

What do I need to do to enable permissions to use Adsense API?

Thanks,

Scott

Ad Sense API

unread,
Jun 5, 2024, 12:40:31 PMJun 5
to adsen...@googlegroups.com
Hi Scott,

Thanks for your message. I'd recommend using the API explorer at https://developers.google.com/adsense/management/reference/rest/v2/accounts/list (the "Try this method" box), to check your user has the appropriate access. There is also sample code for accessing the API, including getting the relevant credentials, at https://developers.google.com/adsense/management/libraries.

I hope this helps.
Regards,
Andrew (AdSense API team)

ref:!00D1U01174p.!5004Q02tJDw1:ref
Reply all
Reply to author
Forward
0 new messages