In this example you will see step-by-step instructions of how to create a java program without frameworks, using pure Java to extract data from your campaign. I assume that you have a campaign configured in your Google Adwords account. I recommend, before you read this paper, to take a look at the following link:
It’s about how the Adwords Api flow and how it was implemented.
To program Adwords call follow the step-by-step below.
1.- Proxy Config:
3.- Build Adwords Query:
4.- Executing query:
In this step we set information as below in the Http Header. One of the most important information is the authorization token refresh in step 2. Beyond the http header data, we need to configure the SOAP envelope, Body and Header. In the Header (RequestHeader) I set the clientCustomerId, developerToken and userAgent. The Body part must be configured depending on which query you want to run, in this case I user the CampaignServiceSoapBinding address location https://adwords.google.com/api/adwords/cm/v201506/CampaignService, operation get.
Below the complete Code:
I hope I have helped you.