Need to bypass all adwords endpoint url to different url from java client library v201708

124 views
Skip to first unread message

hari krishna

unread,
Sep 27, 2017, 5:19:05 AM9/27/17
to AdWords API Forum

Hi,


Our company has a policy that we cannot directly call adwords urls instead we need to call different url that url will intern call adwords apis and give result back to us. Is there any place that we can change this to make it work.   


For example, like below.


Direct url: https://accounts.google.com/o/oauth2/token 

Url we will call : https://dpuatvip.ace.aaaclubnet.com:56000/accounts.google.com/o/oauth2/token (This is what you application will call in dev and testing)

 

 

 

  1. API to call adwords
    1. Direct url:  https://adwords.google.com/api/adwords/cm/v201708/CampaignCriterionService 
    2. url  We will call : https://dpuatvip.ace.aaaclubnet.com:56000/adwords.google.com/api/adwords/cm/v201708/CampaignCriterionService   (This is what you application will call in dev and testing)

Thanks!
Hari. 

 

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Sep 27, 2017, 2:08:11 PM9/27/17
to AdWords API Forum
Hi Hari, 

Appending the AdWords API URL to your server URL might not work as the resultant URL will not be a valid one. Your application will have to have the logic to internally redirect calls from the application to the corresponding AdWords API service/reports. If you are interested in using proxy, you could check this guide to understand how to do that using Java client library. 

Thanks,
Sreelakshmi, AdWords API Team

hari krishna

unread,
Sep 28, 2017, 2:49:09 AM9/28/17
to AdWords API Forum
Thanks Sreelakshmi, 

May i know what is the significance of below property. My intention is not appending my server url, I am trying to call a different url when ever google client library call google url. is there any place i can setup this. Instead of https://adwords.google.com, i will give my own host like https://xxxxxxxxxxxxx.com, so that google client library take my url as host.As I said above my host will call to google apis and give result back to java client library.  Please let me know is there any possibility in setup. 

# Change the AdWords API endpoint. Optional.
#api.adwords.endpoint=https://xxxxxxxxxxxxx.com

Thanks!
Hari. 

Josh Radcliff (AdWords API Team)

unread,
Sep 28, 2017, 12:47:02 PM9/28/17
to AdWords API Forum
Hi Hari,

Is the server that you want to pass your requests through a proxy server? If so, I'd recommend simply setting the proxy system properties as described in the client library's README file here.

Thanks,
Josh, AdWords API Team

hari krishna

unread,
Oct 3, 2017, 3:15:05 AM10/3/17
to AdWords API Forum
Hi Josh, 

No it is not a proxy server. We are using datapower. Using datapower (IBM DataPower Appliances - Service gateway appliance (XG45) )we will create apis which intern call actual adwords apis, From our java adwords client library we would like to call datapower urls instead of adwords apis,I want to know is there any way that I can change the endpoint urls in code so that i can call datapower urls instead of google adwords api.



Thanks!
Hari.
Message has been deleted

hari krishna

unread,
Oct 5, 2017, 6:37:39 AM10/5/17
to AdWords API Forum

Thanks Josh,

 

We want to replace all adwords request URL to our own URL. Since we are using below code, I need some more information on this.

1)      If I use api.adwords.endpoint propery then it will be applicable to below code also.

2)      Can you please let us know what are the request URL go out from below code so that we will prepare our own URL for those?

public AdWordsSession generateAdwordsSession() {

 

              // Generate a refreshable OAuth2 credential.

              Credential oAuth2Credential;

              try {

                      

                     oAuth2Credential = new OfflineCredentials.Builder().forApi(Api.ADWORDS).fromFile().build()

                                  .generateCredential();

 

                     // Construct an AdWordsSession.

                     return new AdWordsSession.Builder().fromFile().withOAuth2Credential(oAuth2Credential).build();

              } catch (OAuthException | ValidationException | ConfigurationLoadException e) {

                     LOGGER.error("Error in getting AdwordsSession with given credentials", e);

                     return null;

              }

 

       }

 

Thanks!

Hari. 

hari krishna

unread,
Oct 25, 2017, 1:02:56 AM10/25/17
to AdWords API Forum
We changed url like this and it is working fine. 

oAuth2Credential = new OfflineCredentials.Builder().forApi(Api.ADWORDS).withTokenUrlServer("www.xxx.com/token/").fromFile().build()
.generateCredential();

Thanks!
Hari. 
Reply all
Reply to author
Forward
0 new messages