Google Adwords CollectionSizeError.TOO_FEW Response Error

118 views
Skip to first unread message

Gregory Gan

unread,
Aug 10, 2021, 8:20:28 PM8/10/21
to AdWords API and Google Ads API Forum
Hi Team,

We're currently using the Google Adwords API to do mutations (i.e. inserts, updates and remove members) onto our audience lists, and have received an error back recently when attempting to remove an audience through an API request. The response back had a status code of 500 and the following error message: 

Error message: Component [Received Unexpected HTTP Response:RECEIVED_UNEXPECTED_HTTP_RESPONSE2] finished with status ERROR. (In0: 1 recs) Didn't get valid response from POST: content: 0005c922dfc2e6f403e7ec9b0d05e813AdwordsUserListServicemutateMembers1158soap:Client[CollectionSizeError.TOO_FEW 

When diagnosing the error, we've found out that it was actually from a malformed request body where we've provided a JSON for the MemberLists object instead of the expected SOAP XML tag (i.e. <memberList> <hasedEmail> </hashedEmail> </memberList>):

<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:RequestHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="https://adwords.google.com/api/adwords/rm/v201809">
<ns1:clientCustomerId>???-???-????</ns1:clientCustomerId>
<ns1:developerToken>ASDyeCacwnHAs5wd1369cQ</ns1:developerToken>
<ns1:userAgent>example.com:AudiencePost:V1.0</ns1:userAgent>
<ns1:validateOnly>false</ns1:validateOnly>
<ns1:partialFailure>false</ns1:partialFailure>
</ns1:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<mutateMembers xmlns="https://adwords.google.com/api/adwords/rm/v201809">
<operations>
<ns7:operator xmlns:ns7="https://adwords.google.com/api/adwords/cm/v201809">REMOVE</ns7:operator>
<operand>
<userListId>??????????</userListId>
<removeAll>false</removeAll>{"hashedEmail&quot;: &quot;5514ff9d5c1bd7b78fd9d441147798c9d2cd821b98c9c65bb5ed757856e9d645&quot; }</operand>
</operations>
</mutateMembers>
</soapenv:Body>
</soapenv:Envelope> 

What we're wondering is why the error status code and message received does not indicate a malformed/invalid request (e.g. a status code of 400 indicating a bad request) instead of the "CollectionSizeError.TOO_FEW " error message with status code 500.

Cheers,
Greg

Google Ads API Forum Advisor

unread,
Aug 11, 2021, 3:54:37 PM8/11/21
to gre...@customology.com.au, adwor...@googlegroups.com
Hi Greg,

Thank you for reporting this. Could you send us privately the full request log (step 3) and response log that has the request Id in it? Logging instructions can be found in every client library readme on github close to the bottom.

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2LmEjM:ref
Reply all
Reply to author
Forward
0 new messages