EntityNotFound.INVALID_ID when trying to remove Keyword.

27 views
Skip to first unread message

Rene Vallecillo

unread,
Feb 27, 2020, 10:41:17 PM2/27/20
to AdWords API and Google Ads API Forum
I'm having this issue with removing keywords. It would be awesome if you could help me figure it out

I'm able to retrieve the the Keyword Criteria(Sample):

Enter code here...
   <rval>
       <totalNumEntries>10</totalNumEntries>
       <Page.Type>AdGroupCriterionPage</Page.Type>
       <entries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BiddableAdGroupCriterion">
           <adGroupId>99941830527</adGroupId>
           <criterionUse>BIDDABLE</criterionUse>
           <criterion xsi:type="Keyword">
               <id>877376356747</id>
               <type>KEYWORD</type>
               <Criterion.Type>Keyword</Criterion.Type>
               <text>agent job 80f9fd28</text>
               <matchType>BROAD</matchType>
           </criterion>
           <AdGroupCriterion.Type>BiddableAdGroupCriterion</AdGroupCriterion.Type>
       </entries>
       <entries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BiddableAdGroupCriterion">
           <adGroupId>99941830527</adGroupId>
           <criterionUse>BIDDABLE</criterionUse>
           <criterion xsi:type="Keyword">
               <id>878118005986</id>
               <type>KEYWORD</type>
               <Criterion.Type>Keyword</Criterion.Type>
               <text>agent job 504b6147</text>
               <matchType>BROAD</matchType>
           </criterion>
           <AdGroupCriterion.Type>BiddableAdGroupCriterion</AdGroupCriterion.Type>
       </entries>
    </rval>
</getResponse>

Then I try to remove a Keyword:

<s11:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
   
<s11:Header>
       
<ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809">
           
<ns1:clientCustomerId>Some customer ID</ns1:clientCustomerId>
           
<ns1:developerToken>some token</ns1:developerToken>
           
<ns1:userAgent></ns1:userAgent>
           
<ns1:validateOnly></ns1:validateOnly>
           
<ns1:partialFailure></ns1:partialFailure>
       
</ns1:RequestHeader>
   
</s11:Header>
   
<s11:Body>
       
<ns1:mutate xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809">
           
<ns1:operations>
               
<ns1:operator>REMOVE</ns1:operator>
               
<ns1:operand xsi:type="ns1:AdGroupCriterion">
                   
<ns1:adGroupId>95704811493</ns1:adGroupId>
                   
<ns1:criterion xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809" xsi:type="ns2:Keyword">
                       
<ns2:id>1070851611272</ns2:id>
                   
</ns1:criterion>
               
</ns1:operand>
           
</ns1:operations>
       
</ns1:mutate>
   
</s11:Body>
</s11:Envelope>

But I keep getting:

<soap:Fault><faultcode>soap:Client</faultcode><faultstring>[EntityNotFound.INVALID_ID @ operations[0].operand.criterion.id; trigger:'CriterionId{id=1070851611272}']</faultstring><detail><ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201809"><message>[EntityNotFound.INVALID_ID @ operations[0].operand.criterion.id; trigger:'CriterionId{id=1070851611272}']</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=1070851611272}</trigger><errorString>EntityNotFound.INVALID_ID</errorString><ApiError.Type>EntityNotFound</ApiError.Type><reason>INVALID_ID</reason></errors></ApiExceptionFault></detail></soap:Fault>

This is in a Dev account just in case it makes any difference.

Google Ads API Forum Advisor Prod

unread,
Feb 28, 2020, 11:26:29 AM2/28/20
to ren...@gmail.com, adwor...@googlegroups.com
Hi Rene,

I wasn't able to find a keyword with the ID 1070851611272 in your ad group 95704811493. Your SOAP request body should look like this:

 <soapenv:Body>
        <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201809">
            <operations>
                <operator>REMOVE</operator>
                <operand>
                    <adGroupId>95704811493</adGroupId>
                    <criterion>
                        <id>1070851611272</id>
                    </criterion>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>

Regards,
Anthony
Google Ads API Team

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