Hi Peter, 

Thank you for the feedback and help. Unfortunately even when using an ADD 
operation the error returned is still stating a id must be set. 

Request and response included below.


<?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:xsi="http://www.w3.org/2001/XMLSchema-instance";>
    <SOAP-ENV:Header>
        <ns1:RequestHeader>
            <ns1:clientCustomerId>XXX-XXX-XXXX</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>unknown (AwApi-PHP, googleads-php-lib/42.0.0, 
PHP/7.3.7-1+ubuntu18.10.1+deb.sury.org+1)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns1:mutate>
            <ns1:operations>
                <ns1:operator>ADD</ns1:operator>
                <ns1:operand>
                    <ns1:campaignId>2087725659</ns1:campaignId>
                    <ns1:criterion xsi:type="ns1:MobileDevice">
                        <ns1:deviceName>Samsung J5 Prime (SM-G570F)
</ns1:deviceName>
                    </ns1:criterion>
                </ns1:operand>
            </ns1:operations>
        </ns1:mutate>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

<soap:Envelope
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
    <soap:Header>
        <ResponseHeader
            xmlns="https://adwords.google.com/api/adwords/cm/v201809";>
            <requestId>0005908c720423fb02ab42cca40bd386</requestId>
            <serviceName>CampaignCriterionService</serviceName>
            <methodName>mutate</methodName>
            <operations>1</operations>
            <responseTime>143</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Client</faultcode>
            <faultstring>[RequiredError.REQUIRED @ 
operations[0].operand.criterion.id]</faultstring>
            <detail>
                <ApiExceptionFault
                    xmlns=
"https://adwords.google.com/api/adwords/cm/v201809";>
                    <message>[RequiredError.REQUIRED @ 
operations[0].operand.criterion.id]</message>
                    <ApplicationException.Type>ApiException
</ApplicationException.Type>
                    <errors
                        xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"; xsi:type="RequiredError">
                        <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></trigger>
                        <errorString>RequiredError.REQUIRED</errorString>
                        <ApiError.Type>RequiredError</ApiError.Type>
                        <reason>REQUIRED</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

I have tried setting the id to 0 and null and give errors of out of range 
and the above XML response, respectively. Do you have any further ideas as 
to what may be going wrong? 

Kind Regards,
James

On Monday, August 19, 2019 at 7:14:19 AM UTC+1, adsapiforumadvisor wrote:
>
> Hi James,
>
> Apologies as we currently do not have an example specifically tailored to 
> your requirement. However, you are correct with the example that you are 
> referring to on how to add targeting criteria to a specific campaign. If 
> you wish to add these in bulk, I would recommend that you also check out 
> our batch processing 
> <https://developers.google.com/adwords/api/docs/guides/batch-jobs> guide 
> (since this supports the CampaignCriterionOperation 
> <https://developers.google.com/adwords/api/docs/reference/v201809/CampaignCriterionService.CampaignCriterionOperation>)
>  as 
> to how.
>
> Moving forward to your issue, the ID 
> <https://developers.google.com/adwords/api/docs/reference/v201809/CampaignCriterionService.MobileDevice#devicename>
>  
> field should only be required when you are passing a SET or REMOVE 
> operation and the said field should not be required for ADD operations. 
> That being said, could you provide the complete SOAP request and response 
> logs so I can further investigate?
>
> You may send your reply using the *Reply privately to author* option.
>
> Thanks and regards,
> Peter
> Google Ads API Team
>
> ref:_00D1U1174p._5001UEJSqY: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/fec255d7-f947-41da-ac7c-2f10ce3e2dd3%40googlegroups.com.

Reply via email to