Yes, I've set the customer id properly. It should return more or less 31
accounts (parent and child) but unexpectedly it return only 12.
I'm using this particular code from the example (returns 12):
private static function printAccountHierarchy($account,
$customerIdsToAccounts, $customerIdsToChildLinks, $depth = null) {
if ($depth === null) {
print "(Customer ID, Account Name)<br>";
self::printAccountHierarchy(
$account, $customerIdsToAccounts, $customerIdsToChildLinks, 0);
return;
}
print str_repeat('-', $depth * 2);
$customerId = $account->getCustomerId();
printf("%s, %s<br>", $customerId, $account->getName());
if (array_key_exists($customerId, $customerIdsToChildLinks)) {
foreach ($customerIdsToChildLinks[$customerId] as $childLink) {
$childAccount =
$customerIdsToAccounts[$childLink->getClientCustomerId()];
self::printAccountHierarchy($childAccount, $customerIdsToAccounts,
$customerIdsToChildLinks, $depth + 1);
}
}
}
But if I try to use this plain code to display accounts, it will return 31
accounts.
foreach ($customerIdsToAccounts as $account) {
echo $account->getName() . '
';
}
What did I missed here? Thanks
On Thursday, July 20, 2017 at 1:55:57 AM UTC+8, Shwetha Vastrad (AdWords
API Team) wrote:
>
> Hi,
>
> Could you check that you have set the clientCustomerId correctly in your
> adsapi_php.ini
> <https://github.com/googleads/googleads-php-lib/blob/master/examples/AdWords/adsapi_php.ini>
> file?
> Could you also check if there are any hidden accounts under your AdWords
> Manager account? Please enable logging
> <https://github.com/googleads/googleads-php-lib#logging> and provide the
> request and response log for this request so I can take a look. Please use
> *Reply
> privately to author* when responding.
>
> Thanks,
> Shwetha, AdWords API Team.
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/6c2cbd90-f1bf-4216-abad-69079ec49df5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.