This is working for me - thank you very much. I'm using Python - example file to use: http://code.google.com/p/google-api-ads-python/source/browse/trunk/examples/adspygoogle/adwords/v201209/misc/use_oauth2.py Do not forget to pass *redirect_uri* argument to the *flow* constructor (use_oauth2.py:49), i.e. redirect_uri='urn:ietf:wg:oauth:2.0:oob' or any other redirect uri from the api console.
Remco On Wednesday, 14 November 2012 03:50:39 UTC+1, Anash P. Oommen wrote: > > Hi Paul, > > The AdWords API PHP library already has a code example that shows how to > use OAuth2 with AdWords API. You can find it here: > http://code.google.com/p/google-api-adwords-php/source/browse/trunk/examples/v201209/Misc/UseOAuth2.php. > > Also, service accounts allow you to call AdWords API without any user > interaction, but that is not the only way to achieve server-to-server call. > If you care only about offline call without user interaction and not about > impersonating users, then you can use regular OAuth2 call with offline = > true as explained here: > https://developers.google.com/accounts/docs/OAuth2WebServer#offline. To > summarize, > > 1. You need to get an OAuth2 clientId and secret from > https://code.google.com/apis/console. When creating the token, select > "Installed Application" and select "Other" in the "Installed Application > type". > 2. Substitute these values in UseOAuth2.php example and run it. This code > example will generate an access token and refresh token. The access token > will expire after an hour, refresh token doesn't. > 3. When your access token expires, refresh it using > $user->RefreshOAuth2AccessToken call. > > You could generate a refresh token for your parent MCC once and continue > using it without requiring user interaction. > > Cheers, > Anash P. Oommen, > AdWords API Advisor. > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en