AdGroupCriteria remove AgeRange failed

76 views
Skip to first unread message

派尼爾

unread,
Sep 26, 2017, 6:11:04 AM9/26/17
to AdWords API Forum

Hi Adwords team,


I failed to remove AgeRange via API AdGroupCriterionService, server raised fault said that "[EntityNotFound.INVALID_ID @ operations[0].operand.criterion.id; trigger:'CriterionId{id=503005}']"
Id "503005" stands for age between 55 ~ 64, and its status is enabled on adwords web.

The following are SOAP and suds messages:

<?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Header>
      <tns:RequestHeader>
         <tns:clientCustomerId>SECRET CLIENT ID</tns:clientCustomerId>
         <tns:developerToken>REDACTED</tns:developerToken>
         <tns:userAgent>adwords-robot (AwApi-Python, googleads/7.0.0, Python/2.7.13)</tns:userAgent>
         <tns:validateOnly>false</tns:validateOnly>
         <tns:partialFailure>false</tns:partialFailure>
      </tns:RequestHeader>
   </SOAP-ENV:Header>
   <ns0:Body>
      <ns1:mutate>
         <ns1:operations>
            <ns1:operator>REMOVE</ns1:operator>
            <ns1:operand xsi:type="ns1:BiddableAdGroupCriterion">
               <ns1:adGroupId>SECRET ADGROUP ID</ns1:adGroupId>
               <ns1:criterion>
                  <ns1:id>503005</ns1:id>
               </ns1:criterion>
               <ns1:AdGroupCriterion.Type>BiddableAdGroupCriterion</ns1:AdGroupCriterion.Type>
            </ns1:operand>
         </ns1:operations>
      </ns1:mutate>
   </ns0:Body>
</SOAP-ENV:Envelope>

[2017-09-26 17:49:42,519 - suds.client - DEBUG] HTTP failed - 500 - Internal Server Error:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201708"><requestId>00055a14982870110a62db84b70f3446</requestId><serviceName>AdGroupCriterionService</serviceName><methodName>mutate</methodName><operations>1</operations><responseTime>161</responseTime></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>[EntityNotFound.INVALID_ID @ operations[0].operand.criterion.id; trigger:'CriterionId{id=503005}']</faultstring><detail><ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201708"><message>[EntityNotFound.INVALID_ID @ operations[0].operand.criterion.id; trigger:'CriterionId{id=503005}']</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="EntityNotFound"><fieldPath>operations[0].operand.criterion.id</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>criterion</field></fieldPathElements><fieldPathElements><field>id</field></fieldPathElements><trigger>CriterionId{id=503005}</trigger><errorString>EntityNotFound.INVALID_ID</errorString><ApiError.Type>EntityNotFound</ApiError.Type><reason>INVALID_ID</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>
[2017-09-26 17:49:42,522 - suds.metrics - DEBUG] <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201708"><requestId>00055a14982870110a62db84b70f3446</requestId><serviceName>AdGroupCriterionService</serviceName><methodName>mutate</methodName><operations>1</operations><responseTime>161</responseTime></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>[EntityNotFound.INVALID_ID @ operations[0].operand.criterion.id; trigger:'CriterionId{id=503005}']</faultstring><detail><ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201708"><message>[EntityNotFound.INVALID_ID @ operations[0].operand.criterion.id; trigger:'CriterionId{id=503005}']</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="EntityNotFound"><fieldPath>operations[0].operand.criterion.id</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>criterion</field></fieldPathElements><fieldPathElements><field>id</field></fieldPathElements><trigger>CriterionId{id=503005}</trigger><errorString>EntityNotFound.INVALID_ID</errorString><ApiError.Type>EntityNotFound</ApiError.Type><reason>INVALID_ID</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>

Bharani Cherukuri (AdWords API Team)

unread,
Sep 26, 2017, 2:05:04 PM9/26/17
to AdWords API Forum
Hello, 

The EntityNotFound.INVALID_ID error occurs when the specified id of the entity is either not accessible in the account specified as the clientCustomerId or the id does not exist. You may want to use the AdGroupCriterionService.get() operation to make sure that the id do exist in the account. Could you provide us adGroupId and the clientCustomerId used for the API call, so we can take a look? Please use Reply privately to author option while responding.

Thanks,
Bharani, AdWords API Team

Bharani Cherukuri (AdWords API Team)

unread,
Sep 27, 2017, 2:26:06 PM9/27/17
to AdWords API Forum
Hello, 

To map the API userStatus to the user interface, you will have to set the TargetingSettingDetail at the AdGroup level using the AdGroupService. The TargetingSettingDetail will specify if a particular criteria type will be used to restrict targeting or only be used to determine the bid for this Ad Group. In this case, you will have to set the TargetingSettingDetail.targetAll to false to restrict your ads to showing only for the criteria you have selected. Please refer to this forum post for more information. Let me know if you have any other questions.

Thanks,
Bharani, AdWords API Team

On Tuesday, September 26, 2017 at 6:11:04 AM UTC-4, 派尼爾 wrote:
Reply all
Reply to author
Forward
0 new messages