Export (0) Print
Expand All

UpdateTargetsInLibrary REST Template

Updates the details of the specified target groups.

/customer/target

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.

    • For enumeration types, you must use numeric values instead of the value name defined in the value set. For example, to specify the TwentyFiveToThirtyFive value defined in the AgeRange value set, set the Age element of the AgeTargetBid object to 1 instead of to TwentyFiveToThirtyFive.

    • All enumerations are zero-based, and increment by 1.

    • 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 update the target groups. Because this operation performs a complete overwrite you must specify all elements that define the target. For a description of each element and the header elements that your request must include, see UpdateTargetsInLibraryRequest Message Object.

System_CLiX_noteNote

You cannot update the Device element of the Target object if a member of the Device OS Targeting pilot program used the UpdateDeviceOSTargets operation to target only tablets or specific smartphone operating systems. The UpdateTargetsInLibrary operation will not fail; however, the device targets will not be updated or deleted.

<UpdateTargetsInLibraryRequest xmlns="http://schemas.datacontract.org/2004/07/HostedService.CampaignManagementService.Rest" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Targets xmlns:d2p1="https://adcenter.microsoft.com/v8">
    <d2p1:Target>
      <d2p1:Age>
        <d2p1:Bid>
          <d2p1:Age></d2p1:Age>
          <d2p1:IncrementalBid></d2p1:IncrementalBid>
        </d2p1:Bid>
      </d2p1:Age>
      <d2p1:Day>
        <d2p1:Bid>
          <d2p1:Day></d2p1:Day>
          <d2p1:IncrementalBid></d2p1:IncrementalBid>
        </d2p1:Bid>
        <d2p1:TargetAllDays></d2p1:TargetAllDays>
      </d2p1:Day>
      <d2p1:Device>
        <d2p1:Devices>
          <d2p1:DeviceType></d2p1:DeviceType>
        </d2p1:Devices>
      </d2p1:Device>
      <d2p1:Gender>
        <d2p1:Bid>
          <d2p1:Gender></d2p1:Gender>
          <d2p1:IncrementalBid></d2p1:IncrementalBid>
        </d2p1:Bid>
      </d2p1:Gender>
      <d2p1:Hour>
        <d2p1:Bid>
          <d2p1:Hour></d2p1:Hour>
          <d2p1:IncrementalBid></d2p1:IncrementalBid>
        </d2p1:Bid>
        <d2p1:TargetAllHours></d2p1:TargetAllHours>
      <d2p1:Id></d2p1:Id>
      <d2p1:IsLibraryTarget i:nil="true" />
      <d2p1:Location>
        <d2p1:BusinessTarget>
          <d2p1:Bids>
            <d2p1:BusinessId></d2p1:BusinessId>
            <d2p1:IncrementalBid></d2p1:IncrementalBid>
            <d2p1:Radius></d2p1:Radius>
          </d2p1:Bids>
        </d2p1:BusinessTarget>
        <d2p1:CityTarget>
          <d2p1:Bids>
            <d2p1:City></d2p1:City>
            <d2p1:IncrementalBid></d2p1:IncrementalBid>
          </d2p1:Bids>
        </d2p1:CityTarget>
        <d2p1:CountryTarget>
          <d2p1:Bids>
            <d2p1:CountryAndRegion></d2p1:CountryAndRegion>
            <d2p1:IncrementalBid></d2p1:IncrementalBid>
          </d2p1:Bids>
        </d2p1:CountryTarget>
        <d2p1:HasPhysicalIntent></d2p1:HasPhysicalIntent>
        <d2p1:MetroAreaTarget>
          <d2p1:Bids>
            <d2p1:IncrementalBid></d2p1:IncrementalBid>
            <d2p1:MetroArea></d2p1:MetroArea>
          </d2p1:Bids>
        </d2p1:MetroAreaTarget>
        <d2p1:RadiusTarget>
          <d2p1:Bids>
            <d2p1:Id></d2p1:Id>
            <d2p1:IncrementalBid></d2p1:IncrementalBid>
            <d2p1:LatitudeDegrees></d2p1:LatitudeDegrees>
            <d2p1:LongitudeDegrees></d2p1:LongitudeDegrees>
            <d2p1:Name></d2p1:Name>
            <d2p1:Radius></d2p1:Radius>
          </d2p1:Bids>
        </d2p1:RadiusTarget>
        <d2p1:StateTarget>
          <d2p1:Bids>
            <d2p1:IncrementalBid></d2p1:IncrementalBid>
            <d2p1:State></d2p1:State>
          </d2p1:Bids>
        </d2p1:StateTarget>
        <d2p1:TargetAllLocations></d2p1:TargetAllLocations>
      </d2p1:Location>
      <d2p1:Name></d2p1:Name>
    </d2p1:Target>
  </Targets>
</UpdateTargetsInLibraryRequest>

Response Body

The response does not include a body. For a description of the TrackingId header element that the response includes, see UpdateTargetsInLibraryResponse 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