AccountHierarchy Same Customer Id Problem

15 views
Skip to first unread message

Mehmet

unread,
Oct 19, 2016, 4:53:45 AM10/19/16
to AdWords API Forum
Hi,

I am trying to get AccountHierachy with the code below. But sometimes while adding to dictionary, I got "An item with the same key has already been added" error.
I think selector.paging.IncreaseOffset(); not work sometimes. Is it possible or I do a mistake?

Thanks


                do
                {
                    page = managedCustomerService.get(selector);

                    if (page.entries != null)
                    {
                        foreach (ManagedCustomer customer in page.entries)
                        {
                            ManagedCustomerTreeNode node = new ManagedCustomerTreeNode();
                            node.Account = customer;
                            customerIdToCustomerNode.Add(customer.customerId, node);
                        }
                    }
                    selector.paging.IncreaseOffset();
                } while (selector.paging.startIndex < page.totalNumEntries);


Peter Oliquino

unread,
Oct 19, 2016, 5:19:31 AM10/19/16
to AdWords API Forum
Hi,

Have you tried the GetAccountHierarchy .NET example? I could see that there is a slight difference in your code and the one in the example. Could you confirm if the issue persists after using the example I have linked? If yes, could you also provide the SOAP request and response so I can take a look at the issue better?

Thanks and regards,
Peter
AdWords API Team

Mehmet

unread,
Oct 19, 2016, 5:24:30 AM10/19/16
to AdWords API Forum
Hi,

Yes, I used .Net example.
I just removed some lines for simplicity while posting.
I will try to reproduce case, because it occurs sometimes not always. And then I will provide request and response.

Thanks


19 Ekim 2016 Çarşamba 12:19:31 UTC+3 tarihinde Peter Oliquino yazdı:

Mehmet

unread,
Nov 9, 2016, 3:32:42 AM11/9/16
to AdWords API Forum
Hi,

I think I found the problem. 
I am fetching users without any ordering. And sometimes, once a day, api returns same users in different pages.
I will try it with ordering today, and if it is ok I will let you know.

Thanks

19 Ekim 2016 Çarşamba 11:53:45 UTC+3 tarihinde Mehmet yazdı:
Reply all
Reply to author
Forward
0 new messages