Thursday, 23 June 2016

Re: Linking account by PHP api

Hi,

I am also having issue linking account 
but errors is [ManagedCustomerServiceError.NOT_AUTHORIZED @ operations[0]]



On Friday, May 23, 2014 at 6:15:49 PM UTC+5, sup...@grafxsoftware.com wrote:
Hi!

I tried to link an account with this code in php AdWords api:

private function linkingUser( & $data )
    {
       
        // Get the service, which loads the required classes.
        $managedCustomerService =
            $this->user->GetService('ManagedCustomerService', ADWORDS_VERSION);


        $link = new ManagedCustomerLink();
        $link->clientCustomerId = $data["googleClientId"];//CLIENT_CID;
        $link->pendingDescriptiveName = "";
        $link->linkStatus = 'PENDING';
        $link->managerCustomerId = $data["googleClientId"];//MANAGER_CID;
       
        // Create operation.
        $operation2 = new LinkOperation();
       
        $operation2->operand = $link;
        $operation2->operator = 'ADD';

        $operations = array( $operation2);
       
       
       
        try
        {
            // Make the mutate request.
            $result = $managedCustomerService->mutate( $operations );
        }
        catch (Exception $e) {
            $this->errors[] = $this->parseAdWordsError( $e->getMessage() );
            return FALSE;
        }
       
       
        if( empty( $result->value[0] ) )
        {
            $error = "AdWordsUser not created (garfx)." ;
            $this->errors[] = $error;
            return FALSE;
        }
               
        return $result->value[0];
    }
   
The response was:

[RequiredError.REQUIRED @ operations[0].operand.customerCurrencyCode, RequiredError.REQUIRED @ operations[0].operand.clientName, RequiredError.REQUIRED @ operations[0].operand.dateTimeZone]

Please help me. What is wrong with my code?

Thx.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/df642b3c-14a5-48eb-894e-c142332ae46d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment