Friday, 24 June 2016

Accounts are not linking

Hi,

I am using PHP library after using OAUTH  i am getting this response 

stdClass Object
(
[access_token] => ya29.Ci8LA6IBQkPj4MFFcimzAyFUBjl-Ve6TPe_kE_n59l4kW3Xjw_QLEWTqMDPeeYl1Ig
[token_type] => Bearer
[expires_in] => 3600
[refresh_token] => 1/79G4Whk7m1Qv9BLMC5_bOtYwVJEO1N_4Y1j-cXN-p9U


Now after Authentication 
)

i want to add that account in my MCC account right now i m using MCC test account.   this is my code for linking 
 
$managedCustomerService =
                $user->GetService('ManagedCustomerService', 'v201603');

            // Create customer.
            $customerService = $user->GetService("CustomerService");
                         
            $cust = $customerService->get();

$linkOperations =array();
            $managecustomerlink =  new ManagedCustomerLink();
            $managecustomerlink->managerCustomerId = xxxxxxxxxx; // Mcc manager customer id
            $managecustomerlink->clientCustomerId=$customer->customerId; user which is logined by oauth
            $managecustomerlink->linkStatus='PENDING';
            $linkOperation = new LinkOperation();
            $linkOperation->operator = 'ADD' ;
            $linkOperation->operand = $managecustomerlink ;
            $linkOperations = array($linkOperation);
//            print_r($linkOperations);
//            exit;
           // $managedCustomerService->mutateLink($linkOperations);
            try{
            $result = $managedCustomerService->mutateLink( $linkOperations );
            } catch (Exception $e) {
            $message = $e->getMessage();
            $this->errors[] = $message;

            return FALSE;
        }

i m getting this error

[ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]]

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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+unsubscribe@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+unsubscribe@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/33a5b726-3601-43a5-86e6-75b58d65d2cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment