Hi Kevin thank you very much for your answer. i found that out a few days ago and just came to write the answer myself :)
greez shai Am Dienstag, 24. Juli 2012 23:44:59 UTC+2 schrieb Kevin Winter: > > Hi Shai, > My Client Center (MCC) accounts can't (normally) have campaigns (once, a > long time ago they could under some circumstances). In order to get the > campaigns for individual accounts, you'll need to call > session.setClientCustomerId(account.account.getCustomerId()). This tells > the session that you want to target a new account for the next request. > > If you want to obtain ALL account data, it will probably be more efficient > to run a "structure" report. When you run a report with no fields that > prevent zero impressions, you get a row for each entity of that report > type. This tends to be more efficient than making all the associated SOAP > calls. > > - Kevin Winter > AdWords API Team > > On Saturday, July 21, 2012 5:24:30 AM UTC-4, Shaihulud wrote: >> >> Hi >> >> i just want to know if this is the right way to get the campaigns.. My >> client center shows that there are campaigns which confuses me and lead me >> to believe that i am doing something wrong here.. >> >> i would really appreciate a little insight >> >> thx >> shai >> >> Am Donnerstag, 19. Juli 2012 12:13:58 UTC+2 schrieb Shaihulud: >>> >>> Hi >>> >>> i am trying to get the campaigns assoziated with my accounts. I dived >>> throuh the example classes and build this little bit of code >>> >>> [code] >>> >>> ... >>> >>> ServicedAccountServiceInterface servicedAccountService = null; >>> // Get the ServicedAccountService. >>> try { >>> servicedAccountService = new AdWordsServices().get(session, >>> ServicedAccountServiceInterface.class); >>> } catch (ReflectionsException e) { >>> } >>> >>> // Create selector. >>> ServicedAccountSelector selector = new ServicedAccountSelector(); >>> // To get the links paging must be disabled. >>> selector.setEnablePaging(false); >>> >>> // Get serviced account graph. >>> ServicedAccountGraph graph = >>> servicedAccountService.get(selector); >>> >>> // Display serviced account graph. >>> if (graph != null) { >>> // Create account tree nodes for each account. >>> for (Account account : graph.getAccounts()) { >>> CampaignServiceInterface campaignServiceInterface = null; >>> try { >>> campaignServiceInterface = new >>> AdWordsServices().get(session, CampaignServiceInterface.class); >>> } catch (ReflectionsException e) { >>> } >>> >>> int offset = 0; >>> >>> // Create selector. >>> Selector selector2 = new Selector(); >>> selector2.setFields(new String[] {"Id", "Name"}); >>> selector2.setOrdering(new OrderBy[] {new OrderBy("Name", >>> SortOrder.ASCENDING)}); >>> selector2.setPaging(new Paging(offset, PAGE_SIZE)); >>> >>> CampaignPage page = null; >>> System.out.println("**CAMPAIGNS**"); >>> do { >>> // Get all campaigns. >>> page = campaignServiceInterface.get(selector2); >>> >>> // Display campaigns. >>> if (page.getEntries() != null) { >>> for (Campaign campaign : page.getEntries()) { >>> >>> [/code] >>> >>> Now i have 2 question because it seems im on the wrongt track here. I >>> would like to get the campaigns specific to an account and not all of them. >>> How can i do that. >>> >>> Also, campaignpage returns null for the entries (Campaign[]), which is >>> weird because there should be several campaigns for eacht of the clients >>> (assuming that each account represents a client !? ). >>> >>> I would apreciate any help. Isnt there any example code that shows the >>> basic operation of getting all infos to a client? campaigns, assoziated, >>> adgroups, associated adtext, assoziated keywords etc? >>> thx for the help >>> shai >>> >> -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en