Get "Invalid Credentials" when call AdSense API (v1.4)

130 views
Skip to first unread message

jh...@appannie.com

unread,
Mar 29, 2016, 9:58:03 AM3/29/16
to AdSense API Forum
Hi,

We are trying to access a user's AdSense report, the user has allowed us to access his AdSense & AdWords and we have the refresh token, we call the "OAuth2.refreshAccessToken" to get access token, it is OK. Then we use the access token to call AdSense API, the API version we are using is v1.4, and language is Nodejs.
When we trying to call adsense.adClients.list(...), it returns
{ [Error: Invalid Credentials]
  code: 401,
  errors:
  [ { domain: 'global',
      reason: 'authError',
      message: 'Invalid Credentials',
      locationType: 'header',
      location: 'Authorization' } ] }

Our code works well for other users' refresh token, but for this user it always failed with above error, how it happens and how can we fix it?

Thanks,

This email may contain or reference confidential information and is intended only for the individual to whom it is addressed.  Please refrain from distributing, disclosing or copying this email and the information contained within unless you are the intended recipient.  If you received this email in error, please notify us at le...@appannie.com immediately and remove it from your system.

Dean Lukies (Adsense API Team)

unread,
Mar 29, 2016, 10:04:41 AM3/29/16
to AdSense API Forum
The error message indicates that the access token you have is not valid for the AdSense API you are calling.

Check that the scope is set corretly and that the originating account has AdSense access.

thanks,
Dean
Reply all
Reply to author
Forward
0 new messages