Campaign Management Service ...


Microsoft Advertising APIs
CampaignManagement AddAdGroups Service Operation

Adds new ad groups to a specified campaign.

Syntax

<wsdl:operation name="AddAdGroups">
  <soap:operation soapAction="AddAdGroups" style="document" />
  <wsdl:input name="AddAdGroupsRequest">
    <soap:header message="tns:AddAdGroupsRequest_Headers" part="ApplicationToken" use="literal" />
    <soap:header message="tns:AddAdGroupsRequest_Headers" part="CustomerAccountId" use="literal" />
    <soap:header message="tns:AddAdGroupsRequest_Headers" part="CustomerId" use="literal" />
    <soap:header message="tns:AddAdGroupsRequest_Headers" part="DeveloperToken" use="literal" />
    <soap:header message="tns:AddAdGroupsRequest_Headers" part="Password" use="literal" />
    <soap:header message="tns:AddAdGroupsRequest_Headers" part="UserName" use="literal" />
    <soap:body use="literal" />
  </wsdl:input>
  <wsdl:output name="AddAdGroupsResponse">
    <soap:header message="tns:AddAdGroupsResponse_Headers" part="TrackingId" use="literal" />
    <soap:body use="literal" />
  </wsdl:output>
  <wsdl:fault name="ApiFaultDetailFault">
    <soap:fault use="literal" name="ApiFaultDetailFault" namespace="" />
  </wsdl:fault>
  <wsdl:fault name="AdApiFaultDetailFault">
    <soap:fault use="literal" name="AdAPIFaultDetailFault" namespace="" />
  </wsdl:fault>
</wsdl:operation>
Request

An AddAdGroupsRequest object that contains the header and parameter information for the service operation.

Response

An AddAdGroupsResponse object that contains the response information for the service request.

Fault

If a Microsoft adCenter API error occurs, a FaultException exception is thrown. It contains one of the following objects:

For more information about fault detail objects, see Microsoft adCenter API Error Handling. For a list of campaign-management–specific error codes, see Campaign Management Error Codes. For a list of generic error codes, see Common Error Codes.

Example SOAP Request

The following is a fictitious example of an AddAdGroups request.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ApplicationToken xmlns:h="https://adcenter.microsoft.com/v6">apptoken</h:ApplicationToken>
    <h:CustomerAccountId xmlns:h="https://adcenter.microsoft.com/v6">customeraccountid</h:CustomerAccountId>
    <h:CustomerId xmlns:h="https://adcenter.microsoft.com/v6">customerid</h:CustomerId>
    <h:DeveloperToken xmlns:h="https://adcenter.microsoft.com/v6">devtoken</h:DeveloperToken>
    <h:Password xmlns:h="https://adcenter.microsoft.com/v6">password</h:Password>
    <h:UserName xmlns:h="https://adcenter.microsoft.com/v6">username</h:UserName>
  </s:Header>
  <s:Body>
    <AddAdGroupsRequest xmlns="https://adcenter.microsoft.com/v6">
      <AdGroups xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <AdGroup>
          <AdDistribution>Search</AdDistribution>
          <BiddingModel>Keyword</BiddingModel>
          <BroadMatchBid i:nil="true"/>
          <CashBackInfo i:nil="true"/>
          <ContentMatchBid i:nil="true"/>
          <EndDate>
            <Day>31</Day>
            <Month>12</Month>
            <Year>2012</Year>
          </EndDate>
          <ExactMatchBid>
            <Amount>10.25</Amount>
          </ExactMatchBid>
          <Id i:nil="true"/>
          <LanguageAndRegion>EnglishUnitedStates</LanguageAndRegion>
          <Name>Eyewear</Name>
          <NegativeKeywords xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <a:string>dog eyewear</a:string>
            <a:string>cat eyewear</a:string>
            <a:string>decorative eyewear</a:string>
          </NegativeKeywords>
          <NegativeSiteUrls i:nil="true" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
          <PhraseMatchBid i:nil="true"/>
          <PricingModel i:nil="true"/>
          <StartDate>
            <Day>16</Day>
            <Month>3</Month>
            <Year>2009</Year>
          </StartDate>
          <Status i:nil="true"/>
        </AdGroup>
        <AdGroup>
          <AdDistribution>Search</AdDistribution>
          <BiddingModel>Keyword</BiddingModel>
          <BroadMatchBid i:nil="true"/>
          <CashBackInfo i:nil="true"/>
          <ContentMatchBid i:nil="true"/>
          <EndDate>
            <Day>31</Day>
            <Month>12</Month>
            <Year>2012</Year>
          </EndDate>
          <ExactMatchBid>
            <Amount>5</Amount>
          </ExactMatchBid>
          <Id i:nil="true"/>
          <LanguageAndRegion>EnglishUnitedStates</LanguageAndRegion>
          <Name>Headwear</Name>
          <NegativeKeywords i:nil="true" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
          <NegativeSiteUrls i:nil="true" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
          <PhraseMatchBid>
            <Amount>0.75</Amount>
          </PhraseMatchBid>
          <PricingModel i:nil="true"/>
          <StartDate>
            <Day>16</Day>
            <Month>3</Month>
            <Year>2009</Year>
          </StartDate>
          <Status i:nil="true"/>
        </AdGroup>
      </AdGroups>
      <CampaignId>1234</CampaignId>
    </AddAdGroupsRequest>
  </s:Body>
</s:Envelope>
Remarks

Because this service operation uses arrays, we recommend that you read the Quotas in Microsoft adCenter topic before you use this service operation. Arrays can consume a large percentage of your allocated quota.

Requirements

WSDL: CampaignManagementService.svc in version 6.

See Also

Other Resources

Quotas in Microsoft adCenter

Page view tracker