Hi,
Yes, I saw that message.

   /the ADD operator and the details of the LinkOperation
   
<https://developers.google.com/adwords/api/docs/reference/v201809/ManagedCustomerService.LinkOperation.html>
 are
   not being included/

If I right understood, that mean that $linkOperation isn't the required format.

I already inserted code but have error (in attachment - error.log, my code - link_account.php)

On 2019-10-21 6:13, Google Ads API Forum Advisor Prod wrote:
Hi,

It appears that you are not able to receive my messages in private. That being said, allow me to write back directly into the forum thread moving forward.

Also, since you were not able to receive my most recent response which I sent last October 9, 2019, you may refer below for its contents :

"/My apologies for the delay. However, I was not able to receive via this thread your response containing your code and SOAP logs. That said, thank you for bumping this thread and including those details.

Moving forward, it appears that in you SOAP request, the ADD operator and the details of the LinkOperation <https://developers.google.com/adwords/api/docs/reference/v201809/ManagedCustomerService.LinkOperation.html> are not being included. That is the reason why you are getting the /OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0], RequiredError.REQUIRED/ error message.

That being said, you may need to update your code implementation and you may refer to the code below :

*$linkOperations = [ ];
$linkOperation = new LinkOperation();

$managedCustomerLink = new ManagedCustomerLink();
$managedCustomerLink->setClientCustomerId($client_id);
$managedCustomerLink->setLinkStatus("PENDING");
$managedCustomerLink->setManagerCustomerId($manager_id);

$linkOperation->setOperand($managedCustomerLink);
$linkOperation->setOperator(Operator::ADD);

$linkOperations [ ] = linkOperation;

$result = $managedCustomerService->mutateLink($linkOperations);*

Could you try the above instead and let me know if the issue would persist?/"

Thanks and regards,
Peter
Google Ads API Team

ref:_00D1U1174p._5001UHHOP0:ref

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d5e1666b-8481-b9a1-a590-57fe5d5af2f1%40gmail.com.
[2019-10-21 12:19:44] AW_SOAP.WARNING: clientCustomerId=179-697-2419 
operations=1 service=ManagedCustomerService method=mutateLink responseTime=179 
requestId=000595682f37299b0a1b88579607638d server=adwords.google.com isFault=1 
faultMessage=[RangeError.TOO_LOW @ operations[0].operand.clientCustomerId.id, 
RangeError.TOO_LOW @ operations[0].operand.managerCustomerId.id]
[2019-10-21 12:19:44] AW_SOAP.NOTICE: POST 
/api/adwords/mcm/v201809/ManagedCustomerService?wsdl HTTP/1.1
Host: adwords.google.com
Connection: close
User-Agent: PHP-SOAP/5.6.40
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 927
Authorization: REDACTED

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809"; 
xmlns:ns2="https://adwords.google.com/api/adwords/mcm/v201809";><SOAP-ENV:Header><ns2:RequestHeader><ns1:clientCustomerId>179-697-2419</ns1:clientCustomerId><ns1:developerToken>REDACTED</ns1:developerToken><ns1:userAgent>unknown
 (AwApi-PHP, googleads-php-lib/40.0.0, 
PHP/5.6.40)</ns1:userAgent><ns1:validateOnly>false</ns1:validateOnly><ns1:partialFailure>false</ns1:partialFailure></ns2:RequestHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns2:mutateLink><ns2:operations><ns1:operator>ADD</ns1:operator><ns2:operand><ns2:managerCustomerId>179</ns2:managerCustomerId><ns2:clientCustomerId>581</ns2:clientCustomerId><ns2:linkStatus>PENDING</ns2:linkStatus></ns2:operand></ns2:operations></ns2:mutateLink></SOAP-ENV:Body></SOAP-ENV:Envelope>

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Date: Mon, 21 Oct 2019 09:19:45 GMT
Expires: Mon, 21 Oct 2019 09:19:45 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alt-Svc: quic=":443"; ma=2592000; v="46,43",h3-Q048=":443"; 
ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
Accept-Ranges: none
Vary: Accept-Encoding
Connection: close

<soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Header><ResponseHeader
 xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809"; 
xmlns="https://adwords.google.com/api/adwords/mcm/v201809";><ns2:requestId>000595682f37299b0a1b88579607638d</ns2:requestId><ns2:serviceName>ManagedCustomerService</ns2:serviceName><ns2:methodName>mutateLink</ns2:methodName><ns2:operations>1</ns2:operations><ns2:responseTime>179</ns2:responseTime></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>[RangeError.TOO_LOW
 @ operations[0].operand.clientCustomerId.id, RangeError.TOO_LOW @ 
operations[0].operand.managerCustomerId.id]</faultstring><detail><ApiExceptionFault
 xmlns="https://adwords.google.com/api/adwords/mcm/v201809"; 
xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809";><ns2:message>[RangeError.TOO_LOW
 @ operations[0].operand.clientCustomerId.id, RangeError.TOO_LOW @ 
operations[0].operand.managerCustomerId.id]</ns2:message><ns2:ApplicationException.Type>ApiException</ns2:ApplicationException.Type><ns2:errors
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="ns2:RangeError"><ns2:fieldPath>operations[0].operand.clientCustomerId.id</ns2:fieldPath><ns2:fieldPathElements><ns2:field>operations</ns2:field><ns2:index>0</ns2:index></ns2:fieldPathElements><ns2:fieldPathElements><ns2:field>operand</ns2:field></ns2:fieldPathElements><ns2:fieldPathElements><ns2:field>clientCustomerId</ns2:field></ns2:fieldPathElements><ns2:fieldPathElements><ns2:field>id</ns2:field></ns2:fieldPathElements><ns2:trigger></ns2:trigger><ns2:errorString>RangeError.TOO_LOW</ns2:errorString><ns2:ApiError.Type>RangeError</ns2:ApiError.Type><ns2:reason>TOO_LOW</ns2:reason></ns2:errors><ns2:errors
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="ns2:RangeError"><ns2:fieldPath>operations[0].operand.managerCustomerId.id</ns2:fieldPath><ns2:fieldPathElements><ns2:field>operations</ns2:field><ns2:index>0</ns2:index></ns2:fieldPathElements><ns2:fieldPathElements><ns2:field>operand</ns2:field></ns2:fieldPathElements><ns2:fieldPathElements><ns2:field>managerCustomerId</ns2:field></ns2:fieldPathElements><ns2:fieldPathElements><ns2:field>id</ns2:field></ns2:fieldPathElements><ns2:trigger></ns2:trigger><ns2:errorString>RangeError.TOO_LOW</ns2:errorString><ns2:ApiError.Type>RangeError</ns2:ApiError.Type><ns2:reason>TOO_LOW</ns2:reason></ns2:errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>

PHP Fatal error:  Uncaught exception 
'Google\AdsApi\AdWords\v201809\cm\ApiException' with message 
'[RangeError.TOO_LOW @ operations[0].operand.clientCustomerId.id, 
RangeError.TOO_LOW @ operations[0].operand.managerCustomerId.id]' in 
/home/www/lira-dev2/adwords/3/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php:43
Stack trace:
#0 
/home/www/lira-dev2/adwords/3/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php(43):
 ReflectionClass->newInstanceArgs(Array)
#1 
/home/www/lira-dev2/adwords/3/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(203):
 Google\AdsApi\Common\Util\Reflection->createInstance('Google\\AdsApi\\A...', 
'[RangeError.TOO...')
#2 
/home/www/lira-dev2/adwords/3/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(164):
 
Google\AdsApi\Common\AdsSoapClient->parseApiExceptionFromSoapFault(Object(SoapFault))
#3 
/home/www/lira-dev2/adwords/3/googleads-php-lib/src/Google/AdsApi/AdWords/v201809/mcm/ManagedCustomerService.php(185):
 Google\AdsApi\Common\AdsSoapClient->__soapCall('muta in 
/home/www/lira-dev2/adwords/3/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php
 on line 43
get( $session, ManagedCustomerService::class ); $client_id = '581-137-4598'; // account under MCC "A" $manager_id = '179-697-2419'; // MCC "B" $linkOperations = [ ]; $linkOperation = new LinkOperation(); $managedCustomerLink = new ManagedCustomerLink(); $managedCustomerLink->setClientCustomerId($client_id); $managedCustomerLink->setLinkStatus("PENDING"); $managedCustomerLink->setManagerCustomerId($manager_id); $linkOperation->setOperand($managedCustomerLink); $linkOperation->setOperator(Operator::ADD); $linkOperations [ ] = $linkOperation; $result = $managedCustomerService->mutateLink($linkOperations); print_r($result); } public static function main() { $oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()->build(); $session = (new AdWordsSessionBuilder())->fromFile()->withOAuth2Credential($oAuth2Credential)->build(); self::runExample(new AdWordsServices(), $session); } } LinkAccount::main();

Reply via email to