AuthenticationError.OAUTH_TOKEN_INVALID and Empty "AdWords API Center" page

197 views
Skip to first unread message

Jeff

unread,
May 22, 2014, 12:57:44 PM5/22/14
to adwor...@googlegroups.com
I have been developing and application against a Test Account and it works well. Now I am trying to connect to our production account and test it there.

I followed the OAUTH2 setup process with my Google Account that has read access to the production MCC and got a new Refresh Token, but when I use that token in the API I get the error:

ReportDownloadException: Report download failed. Underlying errors are 
Type = 'AuthenticationError.OAUTH_TOKEN_INVALID', Trigger = '', FieldPath = ''.

I suspected maybe I didn't have permission to use the dev token against the production account, so I went (logged in as the Google Account with read access to the MCC) to Settings -> Account Settings -> AdWords API Center in order to check if the dev token is indeed approved. But when I go to that page it shows nothing but an empty screen. It doesn't display my existing dev token or give me an option to apply for one.

I think contacted support by phone they did confirm the dev token I'm using is correct and that it is approved, but they weren't able to support me beyond that.

So I have two questions:

1) Is this empty API Center page a bug in the interface? Is it because I'm logged in as a different use than the one who made a Developer Token for the MCC?

2) Why might I be getting this OAUTH_TOKEN_INVALID error, even though I followed the same steps as when I configured my Test Account?

Thanks

Josh Radcliff (AdWords API Team)

unread,
May 23, 2014, 10:42:56 AM5/23/14
to adwor...@googlegroups.com
Hi Jeff,

developer token does not provide authorization to a specific account. In fact, you can use the same developer token to access any account via the API as long as you have authorization (via OAuth) to access the account.

Regarding your questions:

1) Is this empty API Center page a bug in the interface? Is it because I'm logged in as a different use than the one who made a Developer Token for the MCC?

I believe this is by design since the developer token is sensitive information and the user you are logged in has read-only access. If you had another user with administrative access to your MCC then I would expect the dev token to be visible to that user.

2) Why might I be getting this OAUTH_TOKEN_INVALID error, even though I followed the same steps as when I configured my Test Account?

Generally that error indicates that the Authorization header is not formatted properly or you accidentally left off some characters. Are you using one of the Client Libraries or are you constructing the requests manually? If the latter, please make sure that the value of your Authorization header is Bearer xxx, where xxx is your OAuth access token.

You can also verify that your access token is valid by appending it to the end of this URL:


If it is invalid the page will contain an error. If the token is valid you will get something like this:

{
 "issued_to": "YOUR_CLIENT_ID",
 "audience": "YOUR_CLIENT_ID",
 "expires_in": 2322,
 "access_type": "offline"
}

Note that you'll need to go this URL before the access token expires (usually ~1 hour).

Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages