I'm probably using an older version and can't create google ads session (java)

12 views
Skip to first unread message

n...@albert.ai

unread,
Apr 22, 2019, 6:08:21 AM4/22/19
to AdWords API and Google Ads API Forum
I'm using this code in java:

//
File propertiesFile = new File("ads.properties.txt");
Credential oAuth2Credential = new OfflineCredentials.Builder().forApi(Api.ADWORDS).fromFile(propertiesFile).build().generateCredential();
AdWordsSession session = new AdWordsSession.Builder().fromFile().withOAuth2Credential(oAuth2Credential).build();
//

But getting an error that says "Invalid configuration in the ads.properties file. Exception: Client ID must be set as api.adwords.clientId in".
In my ads.properties file it says "api.googleads.clientId" and not "api.adwords.clientId" so it seems like I'm using an older java library.

How should I create a session then?

The information contained in this communication and its attachments is intended solely for the use of the individual or entity to whom it is addressed and others authorized to receive it. It is the property of Albert and may contain confidential or legally privileged information. If you are not the intended recipient you are hereby notified that any disclosure, copying, retention, printing or distribution of this communication or any part thereof, or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by responding to this email and then delete all copies of it from your system. Albert is not liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt.

googleadsapi...@google.com

unread,
Apr 22, 2019, 9:35:03 AM4/22/19
to n...@albert.ai, AdWords API and Google Ads API Forum
Hello Niv, 

If you're using the AdWords API, the ads.properties should be of the format (api.adwords) as mentioned here. If you're using Google Ads API, the configuration file will use the format api.googleads instead of api.adwords. Could you please check if you have any other ads.properties file in your project which is referring to the legacy version of the API? 

Thanks,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Reply all
Reply to author
Forward
0 new messages