OAuth - didn't see it mentioned so I thought I'd ask

409 views
Skip to first unread message

chris h

unread,
Oct 7, 2011, 9:37:15 PM10/7/11
to adwor...@googlegroups.com
Does the new adhoc report download support OAuth?

Kevin Winter

unread,
Oct 10, 2011, 10:23:41 AM10/10/11
to adwor...@googlegroups.com
Hi,
  Yes, OAuth is now supported.

- Kevin Winter
AdWords API Team

chris h

unread,
Oct 10, 2011, 3:04:59 PM10/10/11
to AdWords API Forum
Hi Kevin,

That's great news! Could you share info or a code sample on how it
works?

- Chris

Yagmur Coker

unread,
Oct 11, 2011, 12:53:55 PM10/11/11
to back...@gmail.com, AdWords API Forum
Funny this is not mentioned in the blog http://adwordsapi.blogspot.com/2011_10_01_archive.html as it's kind of a big change :)

This is great news!

yagmur

--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

chris h

unread,
Oct 11, 2011, 1:38:38 PM10/11/11
to AdWords API Forum
I'll not get too excited before I see an example. If Google doesn't
give direction, I may try some experiments next week.

On Oct 11, 12:53 pm, Yagmur Coker <yco...@gmail.com> wrote:
> Funny this is not mentioned in the bloghttp://adwordsapi.blogspot.com/2011_10_01_archive.htmlas it's kind of a big

Kevin Winter

unread,
Oct 11, 2011, 5:06:20 PM10/11/11
to adwor...@googlegroups.com
Hi all,
  I just published a blog post regarding OAuth in v201109: http://adwo rdsapi.blogspot.com/2011/10/adwords-api-now-fully-supports-oauth.html

Yagmur Coker

unread,
Oct 11, 2011, 5:14:28 PM10/11/11
to Kevin....@google.com, adwor...@googlegroups.com
Thank you Kevin!

--

MT

unread,
Oct 12, 2011, 2:01:38 AM10/12/11
to AdWords API Forum
How about Oauth 2.0? I use that for Google Analytics API, would be
convenient to use the same for AdWords.

-Mikael

On Oct 12, 12:06 am, Kevin Winter <Kevin.Win...@google.com> wrote:
> Hi all,
>   I just published a blog post regarding OAuth in v201109:http://adwordsapi.blogspot.com/2011/10/adwords-api-now-fully-supports-oauth.html<http://adwordsapi.blogspot.com/2011/10/adwords-api-now-fully-supports...>

Rob Ryan

unread,
Oct 12, 2011, 7:58:54 AM10/12/11
to adwor...@googlegroups.com
Are we able to get a code sample using OAuth? As I see from the Java code these reports are free of charge correct?
Only key thing I can think of not supported that would be great after this is being able to read the account currency and timezone in the ServicedAccountService.

Kevin Winter

unread,
Oct 12, 2011, 11:12:39 AM10/12/11
to adwor...@googlegroups.com
Hi Mikael,
  Unfortunately, the AdWords API does not yet support OAuth 2.0.  It does support both OAuth 1.0 and 1.0a.

Kevin Winter

unread,
Oct 12, 2011, 11:15:52 AM10/12/11
to adwor...@googlegroups.com
Hi Rob,
  Yes, the new Ad Hoc reports will be free of charge.  The blog post I referenced above for OAuth support contains links to examples in the v201101 versions of the client libraries.  The v201109 versions will also have support for OAuth with the new reports.

Thanks for the feedback regarding currency and timezone.  This is a popular request.

Vijayraj Chauhan

unread,
Oct 14, 2011, 3:22:10 AM10/14/11
to adwor...@googlegroups.com
Hi Kevin,

Its great to hear that Google Adwords now support OAuth authentication.

However after going through the blog i found that there is no example given for authentication using Java Client Library.

It will be really helpful if you provide the code example using Java.

TIA,
Vijayraj

Kevin Winter

unread,
Oct 14, 2011, 9:13:38 AM10/14/11
to adwor...@googlegroups.com
Hi Vijayraj,
  The currently released version of the Java Client Library does not have support for OAuth, so there is no current example to link to.  Once the java client library has been released with support for v201109 it will also have OAuth support (and an OAuth example).

Vijayraj Chauhan

unread,
Oct 14, 2011, 9:29:57 AM10/14/11
to adwor...@googlegroups.com
Its sad that we were waiting for the OAuth authentication for a long time and now when its released it does not support Java client library ...Can you please let us know approximately when will it be released for Java.

TIA,
Vijayraj


Kevin Winter

unread,
Oct 14, 2011, 9:36:44 AM10/14/11
to adwor...@googlegroups.com
Hi,
  We hope to release updated versions of all client libraries within a few weeks.

Vijayraj Chauhan

unread,
Nov 4, 2011, 3:40:26 AM11/4/11
to adwor...@googlegroups.com
Hi Kevin,

I have been following adwords api blog for a while now and thus noticed that the updated versions of all the client libraries have been released...:) However i was unable to find any examples regarding the authentication using OAuth for the Java Client Library. 

I have the access token but i don't know how to use this token to call Adwords API so that I can get the information for that particular user. As in the case of Google Docs API we had something like...
DocsService client = new DocsService("yourCompany-YourAppName-v1");
client
.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());

It will really be helpful if you provide a sample code or any pointers for OAuth authentication using Java.

TIA,
Vijayraj


 

Kevin Winter

unread,
Nov 4, 2011, 9:39:43 AM11/4/11
to adwor...@googlegroups.com
Hi Vijayraj,
  I apologize that the recent release of the Java client library does not have OAuth support.  We have an internal project that has rewritten the Java client library from the group up.  It includes support for OAuth, Maven2 and many other useful features.  However, at the time v201109 came out, we made the decision that the new library was not fully ready for release and so we chose to add support for v201109 to the existing Java library so that Java developers would at least be able to use the new version of the API.

We do not have a firm ETA on when the new Java client library will be published; however, we are committed to releasing it with support for v201109 in advance of the February 2012 sunset and hope to have it out as quickly as possible.

Vijayraj Chauhan

unread,
Nov 7, 2011, 1:14:56 AM11/7/11
to adwor...@googlegroups.com
Does it supports AuthSub Authentication?  If not, is there any other way for authentication other than ClientLogin using Java?

Vijayraj   

Kevin Winter

unread,
Nov 7, 2011, 10:34:06 AM11/7/11
to adwor...@googlegroups.com
Hi Vijayraj,
  No, the Java client library does not support AuthSub (it's an older protocol like ClientLogin).  Unfortunately, ClientLogin will be the only supported authentication until the rewritten java client library is ready.

Vijayraj Chauhan

unread,
Apr 5, 2012, 3:38:50 AM4/5/12
to adwor...@googlegroups.com
Hi Kevin,

Any update on this??? Does the Java client library support any other authentication other than ClientLogin?

TIA,
Vijayraj

Kevin Winter

unread,
Apr 5, 2012, 9:32:44 AM4/5/12
to adwor...@googlegroups.com
Hi Vijayraj,
  We just released the stable version of the new java library: http://code.google.com/p/google-api-ads-java/

This rewritten library works with maven and supports OAuth 1.0a as an authentication mechanism.  We're committing to full support of the new library at this time - it is no longer considered experimental and can be used in production code.

- Kevin Winter
AdWords API Team

Vijayraj Chauhan

unread,
Apr 6, 2012, 7:27:28 AM4/6/12
to adwor...@googlegroups.com
Hi Kevin,

Thanks for the update.....It will be great if you can help me with code example for using OAuth 1.0a with Adwords....
I also wanted to know will it still require to link the customer account to our MCC account after migrating to OAuth authentication??

TIA,
Vijayraj

Kevin Winter

unread,
Apr 6, 2012, 8:45:17 AM4/6/12
to adwor...@googlegroups.com
Hi Vijayraj,
  We've published an example showing how to do OAuth 1.0a with the new java library here: http://code.google.com/p/google-api-ads-java/source/browse/examples/adwords_axis/src/main/java/adwords/axis/v201109/misc/OAuthExample.java

It depends on how you set it up.  You can either authenticate as a user on the MCC, which gives you access to all accounts managed by that MCC, or you could authenticate to the individual client account (which naturally just gives you access to this account) and then you wouldn't need to link the account to an MCC.

- Kevin Winter
AdWords API Team

Ewan Heming

unread,
Apr 6, 2012, 8:45:37 AM4/6/12
to adwor...@googlegroups.com
You shouldn't need to link an account to a your MCC to use ClientLogin or oAuth: Just use the account ClientLogin/oAuth tokens with your developer token.

Ewan Heming

unread,
Apr 6, 2012, 8:49:01 AM4/6/12
to adwor...@googlegroups.com
Hi Kevin,

Does this version of the Java Client Library work with App Engine now?

Thanks,

Ewan

Kevin Winter

unread,
Apr 6, 2012, 9:25:53 AM4/6/12
to adwor...@googlegroups.com
Hi Ewan,
  In theory (and for very simple usage), yes.  However, we're still troubleshooting this issue: http://code.google.com/p/google-api-ads-java/issues/detail?id=3

We've narrowed it down to some interaction with the Jax-ws generated classes and production appengine - we've been able to reproduce with both AdWords and DFP and are currently following up with google internal resources.

If your use case only needs to instantiate 2 or so services in a task, you should be fine.  Performing complex multi-service tasks will cause App Engine to crash for now.  Report downloads are unaffected, as they don't need to instantiate a service.

- Kevin Winter
AdWords API Team

Vijayraj Chauhan

unread,
Apr 9, 2012, 6:03:06 AM4/9/12
to adwor...@googlegroups.com
Hi Kevin,

The example link which you provided for OAuth 1.0a works fine. However looking at the example it seems we still have to pass the clientId even after authenticating..Just the authtoken is not enough to get the campaign info ??

From where can I download the jar files for the latest java client library..This link http://code.google.com/p/google-api-ads-java/ just contains the example programs....??

TIA,
Vijayraj

Kevin Winter

unread,
Apr 9, 2012, 11:11:15 AM4/9/12
to adwor...@googlegroups.com
Hi Vijayraj,
  Currently, the recommend solution is to use Maven and add the correct artifactId and let Maven pull in the AdWords Library as a dependency.  The examples pom.xml can be used for this: http://code.google.com/p/google-api-ads-java/source/browse/examples/adwords_axis/pom.xml

Alternatively, you can browse the maven repository to pull down the individual jars you need: http://search.maven.org/#browse%7C-1058958374

We plan to publish the jars as a download on code.google.com, but we don't yet have that process in place.

- Kevin Winter
AdWords API Team

Vijayraj Chauhan

unread,
Apr 12, 2012, 4:53:00 AM4/12/12
to adwor...@googlegroups.com
Hi Kevin,

I have downloaded the following jar files from maven 

ads-lib-1.0.0.jar
adwords-axis-1.0.0.jar
guice-3.0.jar
commons-configuration-1.8.jar
reflections-0.9.6.jar

I am not able to find this class in maven com.google.common.cache.CacheLoader...can you let me know which jar should be downloaded for this class?? and also is any other jar files needed to be downloaded??

TIA,
Vijayraj

Kevin Winter

unread,
Apr 12, 2012, 10:48:43 AM4/12/12
to adwor...@googlegroups.com
Hi Vijayraj,
I think this dependency is transitive - i.e. the library itself doesn't directly depend on it, but one of the libraries the client library depends on DOES need it. I'm not sure which library pulls it in or where it may be located on maven (jarfinder doesn't help either). We're working on making this process easier and I hope to have some news in the next few days. If you are unable to set up maven and use that to pull in all the dependencies, I'm going to have to ask you to bear with us until we have a proper solution in place. I'll post here when we have news. I apologize for the inconvenience.

- Kevin Winter
AdWords API Team

Anash P. Oommen

unread,
Apr 27, 2012, 2:21:02 AM4/27/12
to adwor...@googlegroups.com
Hi Ewan,

Also look at https://developers.google.com/appengine/docs/python/urlfetch/overview#Quotas_and_Limits. This could limit how big a report you can download and process on AppEngine.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

VijayRaj Chauhan

unread,
May 28, 2012, 10:50:39 AM5/28/12
to adwor...@googlegroups.com
Hi Kevin,

I have been trying Oauth1.0a authentication from the link which you have mentioned earlier  http://code.google.com/p/google-api-ads-java/source/browse/examples/adwords_axis/src/main/java/adwords/axis/v201109/misc/OAuthExample.java ....I also extracted all the dependencies from the file adwords-axis-examples-1.3.0-dependencies.tar.gz, but I still get an error mentioning that GoogleOAuthGetTemporaryToken and GoogleOAuthGetAccessToken does not have transport variable i.e., the error comes from line no. 67 and 102 in that above example...Am I missing something?? Could you pls help me in getting this work??

TIA,
VijayRaj

Kevin Winter

unread,
May 29, 2012, 2:54:34 PM5/29/12
to adwor...@googlegroups.com
Hi VijayRaj,
  I think this is a bug in our maven pom.xml - it's pulling in an old version of the google oauth libs that doesn't have this field and it goes first on the classpath overriding the more recent entry.  Could you please file an issue on our issue tracker while we figure out how best to fix this? http://code.google.com/p/google-api-ads-java/issues/list

- Kevin Winter
AdWords API Team

VijayRaj Chauhan

unread,
May 31, 2012, 10:15:11 AM5/31/12
to adwor...@googlegroups.com
Hi Kevin,

I have filed an issue in the issue tracker....Kindly have a look at it and let us know about the status..

TIA,
VijayRaj

VijayRaj Chauhan

unread,
Jul 17, 2012, 3:43:20 AM7/17/12
to adwor...@googlegroups.com
Hi Kevin,

I have included all the dependency jars from adwords-axis-examples-1.5.0-dependencies.tar in my project....While trying to get Campaigns I get the following error

java.net.URISyntaxException: Illegal character in opaque part at index 7
at java.net.URI$Parser.fail(URI.java:2809)
at java.net.URI$Parser.checkChars(URI.java:2982)
at java.net.URI$Parser.parse(URI.java:3019)
at java.net.URI.<init>(URI.java:578)
at java.net.URL.toURI(URL.java:918)
at org.reflections.vfs.Vfs.normalizePath(Vfs.java:175)
at org.reflections.vfs.Vfs$DefaultUrlTypes$3.matches(Vfs.java:160)
at org.reflections.vfs.Vfs.fromURL(Vfs.java:94)
at org.reflections.vfs.Vfs.fromURL(Vfs.java:88)
at org.reflections.Reflections.scan(Reflections.java:199)
at org.reflections.Reflections.<init>(Reflections.java:91)
at com.google.api.ads.common.lib.AdsModule.<init>(AdsModule.java:60)
at com.google.api.ads.adwords.lib.AdWordsModule.<init>(AdWordsModule.java:43)
at com.google.api.ads.adwords.lib.factory.AdWordsServiceClientFactory.<init>(AdWordsServiceClientFactory.java:41)
at com.google.api.ads.adwords.lib.factory.AdWordsServices.<init>(AdWordsServices.java:68)
at com.google.api.ads.adwords.lib.factory.AdWordsServices.<init>(AdWordsServices.java:50)

Do you have any idea about this error. Any help will be grateful.

TIA,
VijayRaj

Kevin Winter

unread,
Jul 20, 2012, 10:10:23 AM7/20/12
to adwor...@googlegroups.com
Hi VijayRaj,
  I just set up a new eclipse project that only had the jars from adwords-axis-examples-1.5.0-dependencies and added the source of the examples.  I then ran GetCampaigns (which used my homedir ads.properties file) successfully.  What's different about your environment?  Are you using an IDE?  What else is on the classpath besides these jars?

- Kevin Winter
AdWords API Team

VijayRaj Chauhan

unread,
Jul 25, 2012, 3:59:49 AM7/25/12
to adwor...@googlegroups.com
Hi Kevin,

It works fine when I used in IDE...I get this error when I bundled these jars in our web application inside the lib folder...Other than these jars we have only tomcat jars...

TIA,
VijayRaj

Kevin Winter

unread,
Jul 25, 2012, 11:01:48 AM7/25/12
to adwor...@googlegroups.com
Hi VijayRaj,
  We suspect that the reflections library we're using may have issues with certain classpath setups (JBoss in particular).  We're looking into this.

- Kevin Winter
AdWords API Team

VijayRaj Chauhan

unread,
Jul 26, 2012, 1:53:07 AM7/26/12
to adwor...@googlegroups.com
Hi Kevin,

Kindly update this thread once you get any clue about this issue.

TIA,
VijayRaj

Kevin Winter

unread,
Jul 30, 2012, 12:10:53 PM7/30/12
to adwor...@googlegroups.com
Hi VijayRaj,
  I think that at this point this is a client-library-specific issue - could you please file an issue on the project issue tracker with your stacktrace and a quick description of your environemnt?  We're still looking into this, but having it on the issue tracker will keep the library-specific information where it belongs.

- Kevin Winter
AdWords API Team

VijayRaj Chauhan

unread,
Aug 13, 2012, 7:44:52 AM8/13/12
to adwor...@googlegroups.com
Hi Kevin,

OAuth2 authentication is now working fine for java....WIth that token how do I get the current users account information ??. I referred to the GetAccountHierarchy.java example but it returns all the client emails as well as mcc account emails. For e.g, if MCC_1 account is linked to MCC account, running GetAccountHierarchy.java on MCC account will give the result for MCC as well as MCC_1 account...How do I know which is the current account details  (in this case MCC) ??

TIA,
VijayRaj

Kevin Winter

unread,
Aug 13, 2012, 11:47:24 AM8/13/12
to adwor...@googlegroups.com
Hi VijayRaj,
  I'm glad its working for you.  If you are using reports, you'll want to make sure you're using 1.7.1 - 1.7.0 had a bug with report downloads that 1.7.1 fixes.

Regarding account info, you can use the CustomerService to obtain the information for the targeted account - in your scenario, it should return a single record for MCC.

- Kevin Winter
AdWords API Team

VijayRaj Chauhan

unread,
Jan 9, 2013, 2:16:35 AM1/9/13
to adwor...@googlegroups.com
Hi,

I have been using Google Adwords API for sometime now but couldn't find any solution for the couple of questions ...

1) Is it possible to get the list of modified campaigns after a given date (without using download API) ?  I searched in forums but was not able         
    to find any solution and also tried setting DateRange selector but that didn't help either....

2) How to get the currency of the Cost and Average CPC. Right now I am using 
          campaign.getCampaignStats().getAverageCpc().getMicroAmount()
    Dividing this value to 1000000 gives the actual value, but the currency is still unknown ...

Any help or pointers will be grateful:)

TIA,
VijayRaj

David Torres (AdWords API Team)

unread,
Jan 14, 2013, 9:13:28 PM1/14/13
to adwor...@googlegroups.com
Hi VijayRaj,

1) You can use the CustomerSyncService to find out changes that occurred within a DateRange. 

2) The currency is configured at the account level, you can use the CustomerService to find out what the currency code is for the account.

Best,

- David Torres - AdWords API Team
Reply all
Reply to author
Forward
0 new messages