modify
Edit campaign (flight) parameters.
Request format
https://adfox.yandex.com/api/v1
? object=campaign
& action=modify
& objectID=integer
& [name=<string>]
& [advertiserID=<integer>]
& [assistantID=<integer>]
& [kind_id=<integer>]
& [level=<integer>]
& [priority=<integer>]
& [status=<integer>]
& [sectorID=<integer>]
& [rotationMethodID=<integer>]
& [trafficPercents=<integer>]
& [targetingProfileID=<integer>]
& [sequence=<integer>]
& [tracingTypeID=<integer>]
& [isSession=<integer>]
& [outerMarkID=<integer>]
& [isSimplifiedBanners=<integer>]
& [impressionsSmoothTypeID=<integer>]
& [clicksSmoothTypeID=<integer>]
& [isTrafficSmooth=<integer>]
& [maxImpressions=<integer>]
& [maxImpressionsPerDay=<integer>]
& [maxClicks=<integer>]
& [maxClicksPerDay=<integer>]
& [dateStart=<YYYY-MM-DD HH:mm>]
& [dateEnd=<YYYY-MM-DD HH:mm>]
& [logicType=<integer>]
& [cpm=<integer>]
& [cpc=<integer>]
& [sendToErir=<integer>]
& [contractID=<integer>]
& [costType=<integer>]
& [okveds[]=<string>]
& [markingAdvertiserInfo=<string>]
|
ID of the campaign whose parameters you want to edit. |
|
Campaign name. An entry can contain Russian and Latin letters, numbers, and any special characters. |
|
Advertiser ID. For a campaign inside a supercampaign, the advertiser ID is ignored. See also: |
|
ID of the assistant who will be allowed access to the object according to their permissions. For a campaign inside a supercampaign, the assistant ID is ignored. See also: |
|
Defines the campaign type. Acceptable values:
|
|
Campaign level. Depending on whether you connect the “Campaign types” module in the account, a different number of levels is available for campaigns. Acceptable values if the “Campaign types” module is disabled: Acceptable values if the “Campaign types” module is enabled:
Pay attention to the dependence of the |
|
Acceptable values: |
|
Object status. Only objects with the active status can be displayed. Acceptable values:
|
|
See also: |
|
Acceptable values:
|
|
Traffic percentage. Required if the traffic percentage rotation method is used ( Acceptable values: |
|
You can use a targeting profile to combine the settings of several targeting types. When creating a campaign or banner, you can specify a targeting profile. This way, you don't waste time setting up every targeting type separately. See also: |
|
Group. |
|
Action tracing. Acceptable values:
|
|
Acceptable values:
|
|
Enable automatic tag substitution for click links. Acceptable values:
|
|
Simplified banners (additional module). Acceptable values:
|
|
Impression running speed. Acceptable values:
|
|
Click delivery speed. Acceptable values:
|
|
Spread evenly throughout the day. Acceptable values:
|
|
Maximum number of banner impressions. Acceptable values: |
|
Maximum number of impressions per day. Acceptable values: |
|
Maximum total number of clicks. Acceptable values: |
|
Maximum number of clicks per day. Acceptable values: |
|
Delivery start date. Date and time format: |
|
Delivery end date. Date and time format: |
|
Campaign type. Not required for a campaign inside a supercampaign. Acceptable values:
|
|
CPM floor value for a campaign of the Dynamic monetization type. For For Acceptable values: If CPM is passed, don't pass CPC. |
|
CPC floor value for a campaign of the Dynamic monetization type. For For Acceptable values: If CPC is passed, don't pass CPM. |
|
Submit data to the Russian state register. Acceptable values:
|
|
Contract identifier. This parameter is required if |
|
Campaign type. Acceptable values:
|
|
List of OKVED codes of advertised products. If there are multiple codes, submit them using a new parameter, for example: |
|
Information about the advertiser in the banner menu. Displayed if the Show ad menu option is enabled for the banner. by default, this string is empty. |
* Required
Response format
<response>
<status>
<code>{integer}</code>
</status>
</response>
Response parameters
|
Request processing status. For the key, see Error handling. |
Sample request and response
Request:
https://adfox.yandex.com/api/v1?object=campaign&action=modify&objectID=39377&advertiserID=4567
Response:
<response> <status> <code>0</code> </status> </response>
Other actions with the object
See more actions with the campaign
object:
- Add a campaign.
- Get a list of campaigns.
- Delete a campaign.
- Get a list of campaign banners.
- Place a campaign on a site, a site section, or a placement.
- Add a contractor.
- Add a contract.
ID of the campaign whose parameters you want to edit.
Campaign name. An entry can contain Russian and Latin letters, numbers, and any special characters.
Advertiser ID.
For a campaign inside a supercampaign, the advertiser ID is ignored.
See also:
ID of the assistant who will be allowed access to the object according to their permissions.
For a campaign inside a supercampaign, the assistant ID is ignored.
See also:
Defines the campaign type.
Acceptable values:
-
1
: The Guarantee type is used for campaigns with guaranteed sales where there are ad running obligations. Includes the dependence of two parameters:- The
level
parameter can only take values from 1 to 10. If the parameter isn't passed, the default value (1
) is used. - The
cpm
parameter isn't required. If it's passed, its value is ignored.
- The
-
2
: The Dynamic monetization type allows the publisher to receive the highest revenue from impressions, enabling the Yandex Advertising Network to compete for impressions of non-guaranteed campaigns. Campaigns are prioritized by CPM. Includes the dependence of two parameters:- The
level
parameter must be equal to 11. If the parameter isn't passed, the default value11
is used. - The
cpm
parameter is required and must be> 0
. If the campaign was created with an external monetizer, you can't change the Campaign type. Its value must be2
.
- The
-
3
: The Promo type is used for your custom promotion campaigns and placeholders. Includes the dependence of two parameters:- The
level
parameter can only take values from 12 to 20. If the parameter isn't passed, the default value12
is used. - The
cpm
parameter isn't required. If it's passed, its value is ignored.
- The
Campaign level.
Depending on whether you connect the “Campaign types” module in the account, a different number of levels is available for campaigns.
Acceptable values if the “Campaign types” module is disabled: from 1 to 10 inclusive
.
Acceptable values if the “Campaign types” module is enabled:
-
From 1 to 10 inclusive
: for the Guarantee type campaigns (kind_id=1
). -
11
: for the Dynamic monetization type campaigns (kind_id=2
). -
From 12 to 20
: for the Promo type campaigns (kind_id=3
).
Pay attention to the dependence of the kind_id
and cpm
parameter values.
Acceptable values: 1≤N≤1000
, where N is a number from 1 to 1000 inclusive.
Object status. Only objects with the active status can be displayed.
Acceptable values:
-
0
: Active. The object is ready for delivery. -
1
: Paused. The object is assumed to be temporarily disabled. by default, filters in the Adfox web interface show paused objects in the list. -
2
: Completed. The object is assumed to be delivered in full. by default, filters in the Adfox web interface hide completed objects.
See also:
Acceptable values:
-
0
: by priority. Use the level and priority parameter values to estimate the probability of serving the campaign. -
1
: by % of traffic. Use the traffic percentage parameter value to estimate the probability of serving the campaign. ThetrafficPercents
parameter is required.
Traffic percentage.
Required if the traffic percentage rotation method is used (rotationMethodID=1
).
Acceptable values: from 1 to 100
.
You can use a targeting profile to combine the settings of several targeting types. When creating a campaign or banner, you can specify a targeting profile. This way, you don't waste time setting up every targeting type separately.
See also:
Group.
Action tracing.
Acceptable values:
-
0
: Don't track user actions on the advertiser's website. -
1
: PostClick. Count the number of action tracing point downloads within 24 hours after an ad click. -
2
: PostClick and PostView. Count the number of action tracing point downloads after a click and after an impression. -
3
: PostView. Count the number of action tracing point downloads after an impression or 24 hours after a click occurred.
Acceptable values:
-
0
: Disabled. -
1
: Enabled.
Enable automatic tag substitution for click links.
Acceptable values:
-
0
: Disabled. -
1
: Openstat.ru. -
2
: Google Analytics.
Simplified banners (additional module).
Acceptable values:
-
0
: Disabled. -
1
: Enabled.
Impression running speed.
Acceptable values:
-
0
: As fast as possible. Campaign banners are served at the maximum possible speed until the impression limits are reached (if specified). The maximum running speed doesn't require that you specify any limits and start/end dates of the campaign. -
1
: Spread evenly throughout the day. Impressions are uniformly distributed throughout the day. Make sure to specify the maximum number of impressions per day (maxImpressionsPerDay
). -
2
: Spread evenly throughout the entire period. The campaign impressions are distributed evenly over the entire period based on account statistics. Make sure to specify the maximum number of impressions (maxImpressions
) and the campaign end date (dateEnd
). -
3
: Spread evenly throughout the entire period (automatic prolongation). The campaign impressions are distributed evenly over the entire period based on account statistics. If the campaign doesn't reach the impression limit in the allocated time, it's automatically extended for one day and runs at the maximum speed on that day. Make sure to specify the maximum number of impressions (maxImpressions
) and the campaign end date (dateEnd
).
Click delivery speed.
Acceptable values:
-
0
: As fast as possible. Campaign banners are served at the maximum possible speed until the click limits are reached (if specified). The maximum running speed doesn't require that you specify any limits and start/end dates of the campaign. -
1
: Spread evenly throughout the day. Impressions are uniformly distributed throughout the day. Make sure to specify the maximum number of clicks per day (maxClicksPerDay
). -
2
: Spread evenly throughout the entire period. The campaign impressions are distributed evenly over the entire period based on account statistics. Make sure to specify the maximum number of clicks (maxClicks
) and the campaign end date (dateEnd
). -
3
: Spread evenly throughout the entire period (automatic prolongation). The campaign impressions are distributed evenly over the entire period based on account statistics. If the campaign doesn't reach the click limit in the allocated time, it's automatically extended for one day and runs at the maximum speed on that day. Make sure to specify the maximum number of clicks (maxClicks
) and the campaign end date (dateEnd
).
Spread evenly throughout the day.
Acceptable values:
-
0
: Disable. -
1
: Enable.
Maximum number of banner impressions.
Acceptable values: integers from 1 to 2,147,483,647
.
Maximum number of impressions per day.
Acceptable values: integers from 1 to 2,147,483,647
.
Maximum total number of clicks.
Acceptable values: integers from 1 to 2,147,483,647
.
Maximum number of clicks per day.
Acceptable values: integers from 1 to 2,147,483,647
.
Delivery start date.
Date and time format: YYYY-MM-DD HH:mm
.
Delivery end date.
Date and time format: YYYY-MM-DD HH:mm
.
Campaign type. Not required for a campaign inside a supercampaign.
Acceptable values:
-
0
: Commercial. -
1
: Measuring.
CPM floor value for a campaign of the Dynamic monetization type.
For kind_id=2
, the parameter is required.
For kind_id=1|3
, the parameter is optional. But if it's passed, its value is ignored.
Acceptable values: integers from 1 to 99,999
.
If CPM is passed, don't pass CPC.
CPC floor value for a campaign of the Dynamic monetization type.
For kind_id=2
, the parameter is required.
For kind_id=1|3
, the parameter is optional. But if it's passed, its value is ignored.
Acceptable values: an integer > 0
.
If CPC is passed, don't pass CPM.
Submit data to the Russian state register.
Acceptable values:
-
0
: Don't submit data to the Russian state register. -
1
: Submit data to the Russian state register (ad register is enabled).
Contract identifier. This parameter is required if sendToErir=1
. Learn more about getting a list of contracts.
Campaign type.
Acceptable values:
-
0
: Other. -
1
: CPM. -
2
: CPC. -
3
: CPA.
List of OKVED codes of advertised products. If there are multiple codes, submit them using a new parameter, for example: &okveds[]=88.33&okveds[]=77.54
.
Information about the advertiser in the banner menu. Displayed if the Show ad menu option is enabled for the banner. by default, this string is empty.
Required