Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collapse the table of content
Expand the table of content

AddAdGroups Service Operation

System_CLiX_note Note

Version 10 of the Campaign Management service is in preview. The service and documentation are subject to change prior to general availability.

Adds new ad groups to a specified campaign.

Request | Response

Error Codes

Service: CampaignManagementService.svc v10 | Namespace: https://bingads.microsoft.com/CampaignManagement/v10

AddAdGroupsRequest Message

Request Body

The AddAdGroupsRequest object defines the elements of the request’s body. The elements must be in the same order as shown in the SOAP example.



Data Type


An array of AdGroup objects to add to the specified campaign.

You can add a maximum of 1,000 ad groups in a single call. The total number of ad groups that you can add to a campaign depends on your service level. For a list of limits for a standard user, see Entity Hierarchy and Limits.

AdGroup array


The identifier of the campaign to add the ad groups to.


Request Header

For information about the values you set the DeveloperToken, Password, and UserName elements to, see Getting Started With the Bing Ads API.



Data Type


The application-access token. This header element is not used and should be null.



The OAuth access token used to manage Bing Ads accounts linked to a Microsoft Account. For more information, see Managing User Authentication with OAuth.



The identifier of the account that owns the entities in the request.



The identifier of the customer that owns the account.



The client application's developer access token.



The Bing Ads user's sign-in password.



The Bing Ads user's sign-in user name. You may not set this element to a Microsoft account.


Request SOAP

The following example shows the complete request envelope.

<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/CampaignManagement/v10">
    <Action mustUnderstand="1">AddAdGroups</Action>
    <ApplicationToken i:nil="false"></ApplicationToken>
    <AuthenticationToken i:nil="false"></AuthenticationToken>
    <CustomerAccountId i:nil="false"></CustomerAccountId>
    <CustomerId i:nil="false"></CustomerId>
    <DeveloperToken i:nil="false"></DeveloperToken>
    <Password i:nil="false"></Password>
    <UserName i:nil="false"></UserName>
    <AddAdGroupsRequest xmlns="https://bingads.microsoft.com/CampaignManagement/v10">
      <AdGroups i:nil="false">
          <AdDistribution i:nil="false"></AdDistribution>
          <AdRotation i:nil="false">
            <EndDate i:nil="false"></EndDate>
            <StartDate i:nil="false"></StartDate>
            <Type i:nil="false"></Type>
          <BiddingModel i:nil="false"></BiddingModel>
          <ContentMatchBid i:nil="false">
            <Amount i:nil="false"></Amount>
          <EndDate i:nil="false">
          <ForwardCompatibilityMap xmlns:e8="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
              <e8:key i:nil="false"></e8:key>
              <e8:value i:nil="false"></e8:value>
          <Id i:nil="false"></Id>
          <Language i:nil="false"></Language>
          <Name i:nil="false"></Name>
          <NativeBidAdjustment i:nil="false"></NativeBidAdjustment>
          <Network i:nil="false"></Network>
          <PricingModel i:nil="false"></PricingModel>
          <SearchBid i:nil="false">
            <Amount i:nil="false"></Amount>
          <Settings i:nil="false">
            <Setting i:type="-- reserved for future use --">
              <Type i:nil="false"></Type>
          <StartDate i:nil="false">
          <Status i:nil="false"></Status>
          <TrackingUrlTemplate i:nil="false"></TrackingUrlTemplate>
          <UrlCustomParameters xmlns:e9="http://schemas.datacontract.org/2004/07/Microsoft.AdCenter.Advertiser.CampaignManagement.Api.DataContracts.V10" i:nil="false">
            <e9:Parameters i:nil="false">
                <e9:Key i:nil="false"></e9:Key>
                <e9:Value i:nil="false"></e9:Value>

AddAdGroupsResponse Message

Response Body



Data Type


A list of unique system identifiers corresponding to the ad groups that were added.

The list of identifiers corresponds directly to the list of ad groups in the request. Items of the list may be returned as null. For each list index where an ad group was not added, the corresponding element will be null.

long array


An array of BatchError objects that contain details for any ad groups that were not successfully added.

The list of errors corresponds directly to the list of ad groups in the request. Items of the list may be returned as null. For each list index where an ad group was successfully added, the corresponding error element will be null. Ideally all ad groups are added successfully and all elements in this list are null.

BatchError array

Response Header



Data Type


The identifier of the log entry that contains details about the API call.


Response SOAP

The following example shows the complete response envelope.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/CampaignManagement/v10">
    <TrackingId p4:nil="false" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance"></TrackingId>
    <AddAdGroupsResponse xmlns="https://bingads.microsoft.com/CampaignManagement/v10">
      <AdGroupIds p4:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">
      <PartialErrors p4:nil="false" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">
        <BatchError p4:type="-- specify derived type here with the appropriate prefix --">
          <Details p4:nil="false"></Details>
          <ErrorCode p4:nil="false"></ErrorCode>
          <FieldPath p4:nil="false"></FieldPath>
          <ForwardCompatibilityMap xmlns:e9="http://schemas.datacontract.org/2004/07/System.Collections.Generic" p4:nil="false">
              <e9:key p4:nil="false"></e9:key>
              <e9:value p4:nil="false"></e9:value>
          <Message p4:nil="false"></Message>
          <Type p4:nil="false"></Type>
          <!--Keep these fields if you set the i:type attribute to EditorialError-->
          <Appealable p4:nil="false"></Appealable>
          <DisapprovedText p4:nil="false"></DisapprovedText>
          <Location p4:nil="false"></Location>
          <PublisherCountry p4:nil="false"></PublisherCountry>

Error Codes

If the service operation fails, it throws a FaultException exception, which contains one or more of the Bing Ads API error data objects. For information about the fault detail objects, see Campaign Management Error Data Objects and Handling Service Errors and Exceptions.

The following are example error codes that the error objects can include when using this service operation. For all documented error codes, please see Bing Ads Operation Error Codes.

Error Code


Community Additions

© 2015 Microsoft