1
votes

I'm trying to get to grips with Adwords API with OAuth2 authorisation.

I can authorise an account to get an authorisation code. I can exchange this code for an OAuth2 access_token/refresh_token. But what next ...?

The Google Adwords API SOAP request headers require authToken, developerToken, and userAgent (with clientCustomerId being optional). Can anyone point me towards documentation that goes from access_token to authToken (I presume that's the element I'm missing).

I'm working in Python, and have successfully used the Python Adwords library, as well as using suds as the SOAP client to call the API directly, using username/password to create the authToken, but I need to move to the OAuth2 implementation for my app.

I've searched on the interwebs, in the Google Adwords Group, and here on StackOverflow, but haven't found anything to help. I've looked at the OAuth2 playground but haven't managed to get that to do any of the SOAP related calls yet, though that's my next point of call.

Any help or suggestions would be most appreciated.

Cheers H

2

2 Answers

1
votes

The AdWords API doesn't actually support oAuth 2.o yet, so that's probably your problem; it currently only supports 1.0a. The python example code can be found here: http://code.google.com/p/google-api-adwords-python-lib/source/browse/trunk/examples/adspygoogle/adwords/other/use_oauth.py

1
votes

Actually, it is here:

http://code.google.com/p/google-api-ads-python/wiki/AdWordsOAuth2

it should point you in the correct direction. It just seems Google puts the previous version up front (http://code.google.com/p/google-api-ads-python/wiki/AdWordsOAuth). That page should definitely be marked as deprecated and point to the new one.

Hope this helps.