Hi, Sorry for my brief response. I did understand your situation but my response seemed not. :-) Actually, I intended to ask if you have tried filling in the clientCustomerId of* your MCC account *in App.config?
If you do so and all child accounts are really linked to your MCC account, they should get populated. You don't need to specify your child accounts' customer ID one by one. Note that this will return a *ManagedCustomerLink* for the MCC itself, plus both AdWords and MCC accounts under the MCC. You can differentiate between MCC and AdWords accounts using the canManageClients <https://developers.google.com/adwords/api/docs/reference/v201502/ManagedCustomerService.ManagedCustomer#canManageClients> field. You may find this example <https://github.com/googleads/googleads-dotnet-lib/blob/master/examples/AdWords/CSharp/v201502/AccountManagement/GetAccountHierarchy.cs> similar to what you would like to do. Basically, if you don't specify any CID, the code will not work. Cheers, Thanet On Thursday, April 9, 2015 at 12:36:53 PM UTC+1, Aswini wrote: > > Could you please try to understand issue. Test Mcc account have multiple > clients(around 60 ), We can't take each and every Client Id from Mcc > account and store into Local DB. Solving this manual process we did > automated with following code which was version *v201406 * > > *Code: * > > > > > > > > > > > > > > *ManagedCustomerService managedCustomerService = > (ManagedCustomerService)user.GetService(AdWordsService.v201409.ManagedCustomerService); > > managedCustomerService.RequestHeader.clientCustomerId = null; > // Create selector. Selector selector = new Selector(); > selector.fields = new String[] { "Login", "CustomerId", "Name" > }; try { ManagedCustomerPage page = > managedCustomerService.get(selector); if (page.entries != > null) { // Create map from customerId to > customer node. //Dictionary<long, > ManagedCustomerTreeNode> customerIdToCustomerNode = > //new Dictionary<long, ManagedCustomerTreeNode>(); // > Create account tree nodes for each customer. foreach > (ManagedCustomer customer in page.entries) { > dtClients.Rows.Add(customer.customerId.ToString(), > customer.name.ToString(), "");// > ///customer.login.ToString()); ///The login field > can no longer be used in the ManagedCustomer class within the > ManagedCustomerService. ///See this blog > post(http://googleadsdeveloper.blogspot.com/2014/09/login-field-sunsetting-in-adwords-api.html > > <http://googleadsdeveloper.blogspot.com/2014/09/login-field-sunsetting-in-adwords-api.html>) > > for more information. /// } > } dbConnection.Open(); if > (dtClients.Rows.Count != 0) { > genUtilities.eraseAdWords("Clients"); using (SqlBulkCopy > s = new SqlBulkCopy(dbConnection))///inserting campaigns to DB > { s.DestinationTableName = "Clients"; > foreach (var column in dtClients.Columns) > s.ColumnMappings.Add(column.ToString(), column.ToString()); > s.WriteToServer(dtClients); } > } } catch (AdWordsApiException ex) { > ApiException innerException = ex.ApiException as > ApiException; LogFile("Failed to download Client Id's from > google server ", "", innerException.errors.ToString(), > innerException.message.ToString()); } catch > (Exception ex) { LogFile("Failed to download > Client Id's from google server ", "", ex.Data.ToString(), > ex.InnerException.Data.ToString()); } finally > { if (dbConnection.State == ConnectionState.Open) > { dbConnection.Close(); } > } }This Code is perfectly working and i am able to store in > local Database.After Migration Into version v201409 1 > (user.Config as AdWordsAppConfig).ClientCustomerId = "442-017-1224"; > 2 // Get the ManagedCustomerService. 3 ManagedCustomerService > managedCustomerService = > (ManagedCustomerService)user.GetService(AdWordsService.v201409.ManagedCustomerService); > > 4 // Create selector. 5 Selector selector = new > Selector(); 6 selector.fields = new String[] { > "CustomerId", "Name" }; 7 try 8 { 9 > ManagedCustomerPage page = managedCustomerService.get(selector); 10 > if (page.entries != null) 11 { 12 // > Create map from customerId to customer node. 13 > //Dictionary<long, ManagedCustomerTreeNode> customerIdToCustomerNode = > 14 //new Dictionary<long, ManagedCustomerTreeNode>(); > 15 // Create account tree nodes for each customer. 16 > foreach (ManagedCustomer customer in page.entries) 17 > { > dtClients.Rows.Add(customer.customerId.ToString(), > customer.name.ToString(), "");// > ///customer.login.ToString()); ///The login field > can no longer be used in the ManagedCustomer class within the > ManagedCustomerService. ///See this blog > post(http://googleadsdeveloper.blogspot.com/2014/09/login-field-sunsetting-in-adwords-api.html > > <http://googleadsdeveloper.blogspot.com/2014/09/login-field-sunsetting-in-adwords-api.html>) > > for more information. /// } > } dbConnection.Open(); if > (dtClients.Rows.Count != 0) { > genUtilities.eraseAdWords("Clients"); using (SqlBulkCopy > s = new SqlBulkCopy(dbConnection))///inserting campaigns to DB > { s.DestinationTableName = "Clients"; > foreach (var column in dtClients.Columns) > s.ColumnMappings.Add(column.ToString(), column.ToString()); > s.WriteToServer(dtClients); } > } } catch (AdWordsApiException ex) { > ApiException innerException = ex.ApiException as > ApiException; LogFile("Failed to download Client Id's from > google server ", "", innerException.errors.ToString(), > innerException.message.ToString()); } catch > (Exception ex) { LogFile("Failed to download > Client Id's from google server ", "", ex.Data.ToString(), > ex.InnerException.Data.ToString()); } finally > { if (dbConnection.State == ConnectionState.Open) > { dbConnection.Close(); } > }* > > > If i will comment 1st line of the code its throwing Error > : CLIENT_CUSTOMER_ID_IS_REQUIRED Error, Other wise i am downloading only > the assigned Client Id details. Is there any way to download all Client Ids > from Mcc account ??? > > On Thursday, April 9, 2015 at 4:51:45 PM UTC+5:30, Thanet Knack > Praneenararat (AdWords API Team) wrote: >> >> Hi Aswini, >> >> Have you set your clientCustomerId in App.config? >> >> Cheers, >> Thanet >> >> On Thursday, April 9, 2015 at 10:53:06 AM UTC+1, Aswini wrote: >>> >>> HI Marcin, >>> >>> *Actually i need to download Client id from MCC account. Is there any >>> way to download ?? version v201406 using of *ManagedCustomerService i >>> downloaded Client Id's. after migrating into *v201409 i am facing these >>> issue. Is there any way to download all client Id's from MCC account ??* >>> >>> On Thursday, April 9, 2015 at 2:12:42 PM UTC+5:30, Marcin Gdak wrote: >>>> >>>> Hi Aswini, >>>> >>>> You must have CustomerId before the request to ManagedCustomerService. >>>> CustomerId you can charge from Customer Service >>>> <https://developers.google.com/adwords/api/docs/reference/v201502/CustomerService> >>>> . >>>> >>>> >>>> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 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 --- 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 adwords-api+unsubscr...@googlegroups.com. 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/7e1b0dde-6da7-48b8-994f-32de79bece43%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.