hi 

                   Thnks for your reply  but using 
ManagedCustomerService.get 
<https://developers.google.com/adwords/api/docs/reference/v201708/ManagedCustomerService#get>
 and Account Management 
<https://developers.google.com/adwords/api/docs/samples/php/account-management> 
I 
create new account under manager account, but still I getting error 
[AuthorizationError.USER_PERMISSION_DENIED 
@ ; trigger:'<null>'] 

I need to get customer id which I want to log in for getting those account 
report.

in this below code if I have use withClientCustomerId('xxx-xxx-xxx') in 
session then its give error  
[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED 
@ ; trigger:'<null>'].

My code is below :

 $session = (new AdWordsSessionBuilder())
            ->fromFile(base_path() . '/adsapi_php.ini')
            ->withClientCustomerId('xxx-xxx-xxx') // this is my manager 
account id
            ->withOAuth2Credential($oauth2)
            ->build();

$customer = new ManagedCustomer();
                $customer->setName('Account #' . uniqid());
                $customer->setCurrencyCode('USD');
                $customer->setDateTimeZone('Europe/London');

                $operations = [];
                $operation = new ManagedCustomerOperation();
                $operation->setOperator(Operator::ADD);
                $operation->setOperand($customer);
                $operations[] = $operation;

                $adWordsServices = new AdWordsServices();
                
                $managedCustomerService =
                $adWordsServices->get($session, 
ManagedCustomerService::class);

                $customer = 
$managedCustomerService->mutate($operations)->getRval()[0];

                $cust_id = $customer->getCustomerId();
                $user->client_customer_id=$cust_id; // i need this id

On Monday, August 21, 2017 at 9:14:07 AM UTC+5:30, Peter Oliquino wrote:
>
> Hi,
>
> If you wish to retrieve the list of customers linked to your MCC, then you 
> may use the ManagedCustomerService.get 
> <https://developers.google.com/adwords/api/docs/reference/v201708/ManagedCustomerService#get>
>  and 
> refer to the GetAccountHierarchy 
> <https://developers.google.com/adwords/api/docs/samples/java/account-management#get-the-account-hierarchy-under-the-current-account>
>  example 
> (other supported languages are also available in the link).
>
> As for generating all of your accounts' reports using your MCC, you may 
> refer to the Parallel Report Download 
> <https://developers.google.com/adwords/api/docs/samples/java/reporting#parallel-report-download>
>  example. 
> Let me know if this helps.
>
> Best regards,
> Peter
> 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 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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/eb080c01-edb5-4c43-860b-13c07630b080%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to