Hi,

I am trying to Link a google use account to Mcc acount 

this is my code 

$user = new AdWordsUser();
            //$user->SetDeveloperToken($developerToken);
            $user->SetOAuth2Info(array(
                "client_id" => $clientId,
                "client_secret" => $clientSecret
            ));
             
                $code = $_REQUEST["code"];
                $oAuth2Handler = $user->getOAuth2Handler();
          // echo $oAuth2Handler->GetOAuth2AccessToken($authCode, 
$callbackUrl);
             $user_info =    $user->SetOAuth2Info(
                $oAuth2Handler->GetAccessToken($user->GetOAuth2Info(), 
$code, $callbackUrl));
             
                 $oauthInfo = $user->GetOAuth2Info();
                 $customerService = $user->GetService("CustomerService");
                $customer = $customerService->get();
               // echo $customer->customerId; exit;
                 $user->SetClientCustomerId($customer->customerId);
 $managedCustomerService =
                $user->GetService('ManagedCustomerService', 'v201603');

            // Create customer.
            $customer = new ManagedCustomer();
            $customer->name = 'Account #' . uniqid();
            $customer->currencyCode = 'EUR';
            $customer->dateTimeZone = 'Europe/London';
            //$customer->email

            // Create operation.
            $operation = new ManagedCustomerOperation();
            $operation->operator = 'ADD';
            $operation->operand = $customer;

            $operations = array($operation);

            // Make the mutate request.
            $result = $managedCustomerService->mutate($operations);
//            print '<pre>';
           $customer = $result->value[0];

But this error is getting 

ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]


Please help me 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/0390ed53-db9d-4dc7-9a78-47ae38a7fff7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Link client to ... asma batool
    • Re: Link c... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum

Reply via email to