Export (0) Print
Expand All

SetNegativeKeywordsToAdGroups REST Template

Adds negative keywords to the specified ad groups.

/customer/account/campaign/{CampaignId}/adGroup?$field=negativeKeywords

Variables

CampaignId

The identifier of the campaign that contains the ad groups to which you want to add negative keywords.

Query Parameters

field

The negativeKeywords value is a constant string that indicates that the PUT method is adding negative keywords to the specified ad groups. The body of the request includes the list of ad group identifiers and the negative keywords that you want to add to each ad group.

Request Components

The following specifies the HTTP method, supported content types, and base URI to use in your request.

  • HTTP method: PUT

  • Supported content types: XML and JSON

    • To use JSON, your request URL must include the “format=json” query string.

    • The key names that you use for the JSON members are the same as the elements of the XML objects shown in the examples below.

  • Production base URI: https://adcenterapi.microsoft.com/Api/Advertiser/v8/CampaignManagement/CampaignManagementServiceREST.svc

  • Sandbox base URI: Not available.

If the web browser or firewall does not support the PUT method, use the POST method and include the X-HTTP-Method-Override header. Set the X-HTTP-Method-Override header value to PUT.

Request Headers

The following are the headers to include in your request.

Header

Description

ApplicationToken

The application access token. This header is not used.

CustomerAccountId

The account identifier. For more information, see Account and Customer Identifiers.

CustomerId

The customer identifier. For more information, see Account and Customer Identifiers.

DeveloperToken

The developer access token.

Password

The user’s logon password.

UserName

The user’s logon user name.

Request Body

The following XML fragment shows the elements to use to set the negative keywords for the specified ad groups. For a description of each element and the header elements that your request must include, see SetNegativeKeywordsToAdGroupsRequest Message Object.

<SetNegativeKeywordsToAdGroupsRequest xmlns="http://schemas.datacontract.org/2004/07/HostedService.CampaignManagementService.Rest" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <AdGroupNegativeKeywords xmlns:d2p1="https://adcenter.microsoft.com/v8">
    <d2p1:AdGroupNegativeKeywords>
      <d2p1:AdGroupId></d2p1:AdGroupId>
      <d2p1:NegativeKeywords xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <a:string></a:string>
      </d2p1:NegativeKeywords>
    </d2p1:AdGroupNegativeKeywords>
  </AdGroupNegativeKeywords>
</SetNegativeKeywordsToAdGroupsRequest>

Response Body

The response does not include a body. For a description of the TrackingId header element that the response includes, see SetNegativeKeywordsToAdGroupsResponse Message Object.

Faults

If an error occurs, the service returns one of the following HTTP error codes.

Code

Description

400

Bad request, which indicates that the request data contains an error. The response will contain either an ApiFaultDetail or AdApiFaultDetail object that identifies the error. For a list of possible error codes, see Campaign Management Error Codes and Common Error Codes.

401

Not authorized.

404

Not found.

405

Method not allowed, which indicates that the URI template is not correct.

500

Server error.

Community Additions

Show:
© 2014 Microsoft