Hello, It looks like you're using the same CID for both clientCustomerId and managerCustomerId, which is not correct. The ManagedCustomerLink is useful for linking two pre-existing accounts together. If you only have one ID available, then you should most likely be creating a new ManagedCustomer instead.
You can see an example of how to do that in PHP here<https://github.com/googleads/googleads-php-lib/blob/2ce0a794af24827ee99c3a900a6b3f905e9bc0d0/examples/AdWords/v201402/AccountManagement/CreateAccount.php> . Alternatively, if you really do have an MCC account and a client account you would like to link, be sure to use the correct IDs in those two fields to set up the link properly. I think the error you're seeing is likely because you put an MCC id in the clientCustomerId field, and then the required fields weren't found on the existing account. Regards, Mike, AdWords API Team On Friday, May 23, 2014 9:15:49 AM UTC-4, 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+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.