Thank you so much for this information there. You helped me out - I got 
confused with the mutate and mutateLink parts.

calling
$result = $managedCustomerService->mutateLink( $operations );

solved the issue, and everything runs smoothly now :)

Cheers,

Thomas


Am Dienstag, 3. Juni 2014 17:16:08 UTC+2 schrieb Josh Radcliff (AdWords API 
Team):
>
> Hi,
>
> The method you're invoking below is actually ManagedCustomerService.mutate 
> <https://developers.google.com/adwords/api/docs/reference/v201402/ManagedCustomerService#mutate>
>  (not ManagedCustomerService.mutateLink 
> <https://developers.google.com/adwords/api/docs/reference/v201402/ManagedCustomerService#mutateLink>),
>  
> so it takes a collection of ManagedCustomerOperation 
> <https://developers.google.com/adwords/api/docs/reference/v201402/ManagedCustomerService.ManagedCustomerOperation>s
>  
> where the operand is a ManagedCustomer 
> <https://developers.google.com/adwords/api/docs/reference/v201402/ManagedCustomerService.ManagedCustomer>
>  (not 
> a ManagedCustomerLink 
> <https://developers.google.com/adwords/api/docs/reference/v201402/ManagedCustomerService.ManagedCustomerLink>).
>  
> *ManagedCustomer* does require the fields mentioned in the error.
>
> I'm not a PHP expert, but I'm guessing that it's not type-aware enough to 
> know that the operands you are passing are the wrong type for the method, 
> hence the slightly confusing error.
>
> Cheers,
> Josh, AdWords API Team
>
> On Tuesday, June 3, 2014 1:52:48 AM UTC-4, fischi wrote:
>>
>> Hi all!
>>
>> I am trying to link a MCC to another MCC, using API v. 201402.
>> My script is this:
>>
>>     $managedCustomerService = $user->GetService('ManagedCustomerService', 
>> ADWORDS_VERSION);
>>
>>     $link = new ManagedCustomerLink();
>>     $link->clientCustomerId = get_user_account( $thisuserdata->ID ); // 
>> getting the MCC of the logged in user
>>     $link->pendingDescriptiveName = "OMPTools #" . uniqid();
>>     $link->linkStatus = 'PENDING';
>>     $link->managerCustomerId = F711_MCC_MAIN; // constant defining the 
>> main MCC
>>     
>>     $operation = new ManagedCustomerOperation();
>>     $operation->operand = $link;
>>     $operation->operator = 'ADD';
>>     $operations = array(  $operation );
>>
>>     try {
>>         $result = $managedCustomerService->mutate( $operations );
>>     } catch (Exception $e) {
>>         $message = $e->getMessage();
>>         $errors[] = $message;
>>     }
>>     if ( is_array( $errors ) ) {
>>         print_r( $errors );
>>     }
>>
>> It is all pretty straight forward, but I do get an Error:
>> [RequiredError.REQUIRED @ operations[0].operand.dateTimeZone, 
>> RequiredError.REQUIRED @ operations[0].operand.clientName, 
>> RequiredError.REQUIRED @ operations[0].operand.customerCurrencyCode]
>>
>> This is odd to me, as the ManagedCustomerLink 
>> <https://developers.google.com/adwords/api/docs/reference/v201402/ManagedCustomerService.ManagedCustomerLink>
>>  does 
>> not list these operands. Am I missing something here? I also tried adding 
>> $link->currencyCode = 'EUR'; - this results in the same Error, eventhough 
>> currencyCode is defined.
>>
>> The AdWords user making the call is the user with access to the account 
>> mentioned in clientCustomerId.
>>
>> The Object I am sending to the API is the following:
>> [0] => ManagedCustomerServiceMutate Object
>>     (
>>         [operations] => Array
>>             (
>>                 [0] => ManagedCustomerOperation Object
>>                     (
>>                         [operand] => ManagedCustomerLink Object
>>                             (
>>                                 [managerCustomerId] => 1155227075
>>                                 [clientCustomerId] => 1155227075
>>                                 [linkStatus] => PENDING
>>                                 [pendingDescriptiveName] => OMPTools 
>> #538d5c46a44c8
>>                             )
>>
>>                         [operator] => ADD
>>                         [OperationType] => 
>>                         [_parameterMap:Operation:private] => Array
>>                             (
>>                                 [Operation.Type] => OperationType
>>                             )
>>
>>                     )
>>
>>             )
>>
>>     )
>>
>> )
>>
>> Any help is greatly appreciated, I am lost in the woods :)
>>
>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to