Change the strategy

Uses the cURL utility

The example shows how to configure the “Optimization of clicks”strategy (with impressions enabled in search results and ad networks) using the Campaigns.update method.

To use this example, the input data must include the OAuth token, the campaign ID, and the amount of the weekly budget (multiplied by 1,000,000). For a request on behalf of an agency, also specify the client login.

curl \
 -H 'Authorization: Bearer TOKEN' \
  -H 'Client-Login: CLIENT_LOGIN' \
  -d '{ "method": "update",
  "params": {
 "Campaigns": [{
 "Id": CAMPAIGN_ID,
 "TextCampaign": {
        "BiddingStrategy": {
          "Search": {
            "BiddingStrategyType": "WB_MAXIMUM_CLICKS",
            "WbMaximumClicks": {
                "WeeklySpendLimit": BUDGET_TOTAL
            }
          },
          "Network": { 
            "BiddingStrategyType": "NETWORK_DEFAULT",
            "NetworkDefault": {  }
          }
        }
      }
    }]
  }
}' https://api.direct.yandex.com/json/v5/campaigns
Note. For cURL in Windows, replace all single quotes with double quotes, and escape double quotes in JSON code. For example: -d "{\"method\"...