Hi Ben,

The cause of this error is that you are not specifying a type for the
CampaignCriterion (the operand element in this case).
CampaignCriterion is like an abstract type (although it can be used
when deleting criteria), and you need to specify a concrete type when
adding your criteria.  The only subtype is currently
NegativeCampaignCriterion, which is what you want.  The request would
look like:

  <soap:Body>
    <mutate xmlns="https://adwords.google.com/api/adwords/cm/
v200906">
      <operations>
        <operator>ADD</operator>
        <operand xsi:type="NegativeCampaignCriterion">
          <campaignId>XXXXX</campaignId>
          <criterion xsi:type="Keyword">
            <text>career</text>
            <matchType>BROAD</matchType>
          </criterion>
        </operand>
      </operations>
      ...
    </mutate>
  </soap:Body>

Best,
- Eric Koleda, AdWords API Team

On Sep 21, 6:37 pm, "Ben Brooks" <b...@brooks.nu> wrote:
> I am having trouble adding negative keywords to a campaign in the new 2009
> API.  If I specify the type it doesn't affect anything.
>
> Any help is appreciated.
>
> Ben.
>
> Here is my request:
>
> <soap:Body>
>
>     <mutate xmlns="https://adwords.google.com/api/adwords/cm/v200906";>
>
>       <operations>
>
>         <operator>ADD</operator>
>
>         <operand>
>
>           <campaignId>XXXXX</campaignId>
>
>           <criterion xsi:type="Keyword">
>
>             <text>career</text>
>
>             <matchType>BROAD</matchType>
>
>           </criterion>
>
> </operand>
>
>       </operations>
>
>       <operations>
>
>         <operator>ADD</operator>
>
>         <operand>
>
>           <campaignId>XXXXXX</campaignId>
>
>           <criterion xsi:type="Keyword">
>
>             <text>hiring</text>
>
>             <matchType>BROAD</matchType>
>
>           </criterion>
>
>           <CampaignCriterion.Type>Keyword</CampaignCriterion.Type>
>
>         </operand>
>
>       </operations>
>
>       <operations>
>
>         <operator>ADD</operator>
>
>         <operand>
>
>           <campaignId>49430996</campaignId>
>
>           <criterion xsi:type="Keyword">
>
>             <text>interns</text>
>
>             <matchType>BROAD</matchType>
>
>           </criterion>
>
>           <CampaignCriterion.Type>Keyword</CampaignCriterion.Type>
>
>         </operand>
>
>       </operations>
>
>       <operations>
>
>         <operator>ADD</operator>
>
>         <operand>
>
>           <campaignId>49430996</campaignId>
>
>           <criterion xsi:type="Keyword">
>
>             <text>job</text>
>
>             <matchType>BROAD</matchType>
>
>           </criterion>
>
>        </operand>
>
>       </operations>
>
>     </mutate>
>
>   </soap:Body>
>
> </soap:Envelope>
>
> Here is my response:
>
> <ApiExceptionFault
> xmlns="https://adwords.google.com/api/adwords/cm/v200906";>
>
>           <message>[CampaignCriterionError.CONCRETE_TYPE_REQUIRED @
> operations[3].operand, CampaignCriterionError.CONCRETE_TYPE_REQUIRED @
> operations[1].operand, CampaignCriterionError.CONCRETE_TYPE_REQUIRED @
> operations[4].operand, CampaignCriterionError.CONCRETE_TYPE_REQUIRED @
> operations[5].operand, CampaignCriterionError.CONCRETE_TYPE_REQUIRED @
> operations[2].operand, CampaignCriterionError.CONCRETE_TYPE_REQUIRED @
> operations[0].operand]</message>
>
> <ApplicationException.Type>ApiException</ApplicationException.Type>
>
>           <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:type="CampaignCriterionError">
>
>             <fieldPath>operations[3].operand</fieldPath>
>
>             <trigger>
>
>             </trigger>
>
>             <ApiError.Type>CampaignCriterionError</ApiError.Type>
>
>             <reason>CONCRETE_TYPE_REQUIRED</reason>
>
>           </errors>
>
> Ben Brooks
> .Net Developer
>
> e:  <mailto:bbro...@orangesoda.com> bbro...@orangesoda.com
> t: 801.610.2500 x.4317
> f: 801.610.2501
>
>  image001.jpg
> 1KViewDownload
>
>  image002.jpg
> 6KViewDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"AdWords 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to