I am receiving the UserListError.CONCRETE_TYPE_REQUIRED error, but have checked all resources online and cannot find where I go wrong.
I have created a CrmBasedUserList and would like to add Member of hashedEmail and hashedPhoneNumber. Some of the things I found online:
* The CrmBasedUserList has listType CRM_BASED so that should look good allthough I read online a lot about that I might be missing operand type in my soal call. But this is not added by default by the MutateMembersOperand class.
* I have tried changing the MutateMembersOperation order of setOperand and setOperator, but that did not help (nor should it be!).
$mutMembers = new MutateMembersOperand();
$mutMembers->setUserListId($userListId);
$memberList[] = new Member($hashedEmail, $mobileId, $hashedPhoneNumber, $addressInfo, $userId);
$mutMembers->setMembersList($memberList);
$operations = [];
$operation = new MutateMembersOperation();
$operation->setOperand($mutMembers);
$operation->setOperator(Operator::ADD);
$operations[] = $operation;
$userListNew = $userListService->mutate($operations)->getValue()[0];
And here is the resulting SOAP.
AW_SOAP.NOTICE: POST /api/adwords/rm/v201809/AdwordsUserListService?wsdl HTTP/1.1
Connection: close
User-Agent: PHP-SOAP/7.2.20RC1
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 2012
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/rm/v201809" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header><ns2:RequestHeader><ns1:developerToken>REDACTED</ns1:developerToken><ns1:userAgent>XXXX (AwApi-PHP, googleads-php-lib/43.0.0, PHP/7.2.20RC1)</ns1:userAgent><ns1:validateOnly>false</ns1:validateOnly><ns1:partialFailure>false</ns1:partialFailure></ns2:RequestHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns2:mutate><ns2:operations xsi:type="ns2:MutateMembersOperation"><ns1:operator>ADD</ns1:operator><ns2:operand><ns2:userListId>853860912</ns2:userListId><ns2:membersList><ns2:hashedEmail>d480ad3fc4b40ae4361e4b26e223a0a5c0f04e3baf92a600ff42690d5576d136</ns2:hashedEmail><ns2:hashedPhoneNumber>4dc2b26583b308da70acbee670b5a5946dc37ca38ee71f9be023a0b093fa5b2b</ns2:hashedPhoneNumber></ns2:membersList></ns2:operand></ns2:operations></ns2:mutate></SOAP-ENV:Body></SOAP-ENV:Envelope>
HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Date: Wed, 25 Sep 2019 14:33:57 GMT
Expires: Wed, 25 Sep 2019 14:33:57 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"
Accept-Ranges: none
Vary: Accept-Encoding
Connection: close
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ns2:ResponseHeader xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201809" xmlns="https://adwords.google.com/api/adwords/cm/v201809"><requestId>000593618b0468990a812f8f26082726</requestId><serviceName>AdwordsUserListService</serviceName><methodName>mutate</methodName><operations>1</operations><responseTime>121</responseTime></ns2:ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>[UserListError.CONCRETE_TYPE_REQUIRED @ operations[0].operand]</faultstring><detail><ns2:ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201809" xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201809"><message>[UserListError.CONCRETE_TYPE_REQUIRED @ operations[0].operand]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:UserListError"><fieldPath>operations[0].operand</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><trigger></trigger><errorString>UserListError.CONCRETE_TYPE_REQUIRED</errorString><ApiError.Type>UserListError</ApiError.Type><ns2:reason>CONCRETE_TYPE_REQUIRED</ns2:reason></errors></ns2:ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>
Exeptionerror: 0 [UserListError.CONCRETE_TYPE_REQUIRED @ operations[0].operand]
Hope you can help and see what I am missing?
Cheers
Lars