hi

i question !

why not update gender ?


java source code


        Gender male = new Gender();
        male.setId(10L);

        NegativeAdGroupCriterion genderNegativeAdGroupCriterion = new 
NegativeAdGroupCriterion();
        genderNegativeAdGroupCriterion.setAdGroupId(41418648415L);
        genderNegativeAdGroupCriterion.setCriterion(male);

        AdGroupCriterionOperation genderAdGroupCriterionOperation = new 
AdGroupCriterionOperation();
        
genderAdGroupCriterionOperation.setOperand(genderNegativeAdGroupCriterion);
        genderAdGroupCriterionOperation.setOperator(Operator.SET);

        AdGroupCriterionReturnValue result = 
adGroupCriterionService.mutate(new 
AdGroupCriterionOperation[]{genderAdGroupCriterionOperation});

        // Display campaigns.
        for (AdGroupCriterion adGroupCriterion : result.getValue()) {
            System.out.printf("AdGroup criterion with adGroup ID %d, 
criterion ID %d, "
                            + "and type '%s' was added.%n", 
adGroupCriterion.getAdGroupId(),
                    adGroupCriterion.getCriterion().getId(),
                    adGroupCriterion.getCriterion().getCriterionType());
        }



==============

error message

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
    <soap:Header>
        <ResponseHeader 
xmlns="https://adwords.google.com/api/adwords/cm/v201702";>
            <requestId>00054eaa7cc37f380a629c09ad097b5f</requestId>
            <serviceName>AdGroupCriterionService</serviceName>
            <methodName>mutate</methodName>
            <operations>1</operations>
            <responseTime>269</responseTime>
        </ResponseHeader>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[AdGroupCriterionError.CANT_UPDATE_NEGATIVE @ 
operations[0].operand]</faultstring>
            <detail>
                <ApiExceptionFault 
xmlns="https://adwords.google.com/api/adwords/cm/v201702";>
                    <message>[AdGroupCriterionError.CANT_UPDATE_NEGATIVE @ 
operations[0].operand]</message>
                    
<ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="AdGroupCriterionError">
                        <fieldPath>operations[0].operand</fieldPath>
                        <fieldPathElements>
                            <field>operations</field>
                            <index>0</index>
                        </fieldPathElements>
                        <fieldPathElements>
                            <field>operand</field>
                        </fieldPathElements>
                        <trigger/>
                        
<errorString>AdGroupCriterionError.CANT_UPDATE_NEGATIVE</errorString>
                        <ApiError.Type>AdGroupCriterionError</ApiError.Type>
                        <reason>CANT_UPDATE_NEGATIVE</reason>
                    </errors>
                </ApiExceptionFault>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>


https://developers.google.com/adwords/api/docs/reference/v201702/AdGroupCriterionService.Gender

This field is required and should not be null when it is contained within 
Operator 
<https://developers.google.com/adwords/api/docs/reference/v201702/AdGroupCriterionService.Operator.html>s
 
: SET, REMOVE.


why not update gender?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d3e5b1ce-18bc-4b80-9b55-502817ee3a49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to