HI All

I'm Trying to pull some data using the data service, i know that this 
service's get methods are a bit different, but im following the API in: 
https://developers.google.com/adwords/api/docs/reference/v201502/DataService

 It seems like my IDE doe's not recognize the other possible get methods, 
as following:

import com.google.api.ads.adwords.axis.factory.AdWordsServices;
import com.google.api.ads.adwords.axis.utils.v201502.SelectorBuilder;
import com.google.api.ads.adwords.axis.v201502.cm.AdGroupBidLandscapePage;
import com.google.api.ads.adwords.axis.v201502.cm.DataService;
import com.google.api.ads.adwords.axis.v201502.cm.Selector;
import com.google.api.ads.adwords.lib.client.AdWordsSession;
import com.google.api.ads.common.lib.auth.OfflineCredentials;
import com.google.api.client.auth.oauth2.Credential;

..........CREDENTIALS......

  public static void main(String[] args) throws Exception {
    // Generate a refreshable OAuth2 credential similar to a ClientLogin 
token
    // and can be used in place of a service account.
    Credential oAuth2Credential = new OfflineCredentials.Builder()
        .forApi(OfflineCredentials.Api.ADWORDS)
        .withClientSecrets(Client_ID, 
Client_secret).withRefreshToken(RefreshToken)
        .build()
        .generateCredential();

    // Construct an AdWordsSession.
    AdWordsSession session = new AdWordsSession.Builder()
        
.withClientCustomerId(clientCustomerId).withDeveloperToken(developerToken).withUserAgent(userAgent)
        .withOAuth2Credential(oAuth2Credential)
        .build();

    AdWordsServices adWordsServices = new AdWordsServices();

    runExample(adWordsServices, session);
  }

  
  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session) throws 
Exception {
    // Get the CampaignService.
    DataService dataService = adWordsServices.get(session, 
DataService.class);

    int offset = 0;

    // Create selector.
    SelectorBuilder builder = new SelectorBuilder();
    Selector selector = builder
        .fields("AdGroupId", "Bid", "CampaignId", "CriterionId", "EndDate", 
"LocalClicks", "LocalCost", "LocalImpressions", "PromotedImpressions", 
"StartDate")
        .build();

    AdGroupBidLandscapePage page = null;
    
    do {
      // Get all data
      page = dataService.getAdGroupBidLandscape(selector); // the problem 
is here : get method isn't  recognized
      
      
      // Display campaigns.
      if (page.getEntries() != null) {
        for ( DataService ds : page.getEntries()) { 
          System.out.println(ds.toString());
        }
      } else {
        System.out.println("No campaigns were found.");
      }

      offset += PAGE_SIZE;
      selector = builder.increaseOffsetBy(PAGE_SIZE).build();
    } while (offset < page.getTotalNumEntries());
  }




Thanks for any help on that :)

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/818896b4-035b-40c4-83c9-af52eb8805f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to