setBids

Sets bids and priorities for dynamic text ad targets for dynamic ads.

  1. Restrictions
  2. Request
  3. Response

You can set a bid or priority for an individual dynamic text ad target, for all dynamic text ad targets in an ad group, or for all dynamic text ad targets in a campaign.

The bid or priority is used depending on which display strategy is selected in the campaign:

  • If the campaign has an automatic strategy set up, the StrategyPriority parameter is used: ads for dynamic text ad targets with higher priority are allocated more traffic when possible, and they are the last ones to be stopped when budget funds are low.

  • If a manual strategy is set up in the campaign, the Bid parameter is used.

The ContextBid parameter is not used at this time.

If an item in the input array contains parameters that are not appropriate for the strategy, the values of these parameters are saved and a warning is issued.

  • If an automatic strategy is set up in the campaign, but the Bid parameter is set for a dynamic text ad target, this bid value won't be applied. When the strategy switches from automatic to manual, the bid will be selected by an automatic algorithm.

  • If a manual strategy is set up in the campaign, but the StrategyPriority parameter is set for a dynamic text ad target, the set priority value will be applied later when the strategy is switched to an automatic one.

Attention.
  • Bids and prices are passed via the Yandex.Direct API as integer numbers. The value that is passed represents the bid or price multiplied by 1,000,000.

  • All bids and prices are shown in the advertiser's currency.

Restrictions

A single request can only set bids for the same type of objects — either for campaigns only, or for groups only, or for dynamic text ad targets only.

Maximum number of objects per method call:

  • campaigns — maximum of 10
  • groups — maximum of 1000
  • dynamic text ad targets — maximum of 10,000.

Request

Request structure in JSON format:

{
  "method": "setBids",
  "params": {  /* params */
    "Bids": [{  /* SetBidsItem */
      "CampaignId": (long),
      "AdGroupId": (long),
      "Id": (long),
      "Bid": (long),
      "ContextBid": (long),
      "StrategyPriority": ( "LOW" | "NORMAL" | "HIGH" )
    }, ... ] /* required */
  }
}
ParameterTypeDescriptionRequired
Params structure (for JSON) / SetRequest structure (for SOAP)
Bidsarray of SetBidsItemBids and/or priorities.Yes
SetBidsItem structure
CampaignIdlongThe campaign ID. Specified if setting the same bid/priority for all dynamic text ad targets in a campaign.Either CampaignId, AdGroupId, or Id
AdGroupIdlongID of the ad group. Specified if setting the same bid/priority for all dynamic text ad targets in a group.
IdlongID of a dynamic text ad target. Specified if setting the bid/priority for an individual dynamic text ad target.
Bidlong

The bid for displays in search results, multiplied by 1,000,000. Integer. Only used for a manual strategy.

Specified in the advertiser's currency. Restrictions are listed in the currency reference. To get it, use the Dictionaries.get method and specify the Currencies dictionary name in the request.

At least one of the parameters Bid or StrategyPriority (or both)
StrategyPriorityPriorityEnumThe priority of the dynamic text ad target: LOW, NORMAL or HIGH. Only used for an automatic strategy.
ContextBidlongThis parameter is reserved for future use.No
Attention. The CampaignId, AdGroupId and Id parameters are mutually exclusive. A single request can only contain one of these parameters.

Response

Response structure in JSON format:

{
  "result": {  /* result */
    "SetBidsResults": [{  /* SetBidsActionResult */
      "CampaignId": (long),
      "AdGroupId": (long),
      "Id": (long),
      "Warnings": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ],
      "Errors": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ]
    }, ... ]
  }
}
ParameterTypeDescription
Result structure (for JSON) / SetResponse structure (for SOAP)
SetBidsResultsarray of SetBidActionResultResults of setting bids and/or priorities.
SetBidActionResult structure
CampaignIdlongThe campaign ID. Returned if there aren't any errors (if it was specified in the request).
AdGroupIdlongID of the ad group. Returned if there aren't any errors (if it was specified in the request).
IdlongID of a dynamic text ad target. Returned if there aren't any errors (if it was specified in the request).
Warningsarray of ExceptionNotification

Warnings that occurred during the operation.

Errorsarray of ExceptionNotification

Errors that occurred during the operation.