banner
Add a banner.
If a banner creative uses an image or video that must be uploaded to the Yandex server, first upload the file and obtain its link, then add the banner. You can only upload files from local storage.
If you need to upload an archive with HTML5 code for your creative (for example, when placing a banner with the Banner HTML5, Banner Interscroller HTML5, or Fullscreen HTML5 template), first create a banner, leaving the HTML5 code parameter empty, then upload the archive using a POST request:
curl --location 'https://adfox.yandex.com/api/v1?object=banner&action=modify&actionObject=zipFile&objectID=1234567'
--form 'zipFile=@"/240x400.zip"'
Where objectID=1234567
is the ID of a previously created banner.
Request format
https://adfox.yandex.com/api/v1
? object=account
& action=add
& actionObject=banner
& campaignID=<integer>
& templateID=<integer>
& [name=<string>]
& [targetingProfileID=<integer>]
& [bannerTypeID=<integer>]
& [priority=<integer>]
& [status=<integer>]
& [isEvents=<integer>]
& [isUnplaced=<integer>]
& [backgroundColor=<string>]
& [width=<string>]
& [height=<string>]
& [imageURL=<string>]
& [hitURL=<string>]
& [target=<string>]
& [alt=<string>]
& [userN=<string>]
& [eventN=<string>]
& [hitURLN=<string>]
& [videoResolution=<string>]
& [videoDuration=<float>]
& [maxImpressions=<integer>]
& [maxImpressionsPerDay=<integer>]
& [maxImpressionsPerHour=<integer>]
& [maxClicks=<integer>]
& [maxClicksPerDay=<integer>]
& [maxClicksPerHour=<integer>]
& [trackingURL=<string>]
& [dateStart=<YYYY-MM-DD HH:mm>]
& [dateEnd=<YYYY-MM-DD HH:mm>]
& [showMenu=<integer>]
& [adLabel=<integer>]
& [domain=<string>]
& [sendToErir=<integer>]
& [token=<string>]
& [creativeContentType=<integer>]
& [markingDescription=<string>]
& [markingKktu=<string>]
& [markingCommonDescription=<string>]
& [markingSendRegionsType=<string>]
& [markingSelectedRegions=<integer>]
& [targetURL=<string>]
& [textData[]=<string>]
& [mediaData[]=<{"url": "media data URL", "description": "string"}>]
& [sendToErir<ParameterN>=<integer>]
& [sendToErirContentType<ParameterN>=<string>]
& [sendToErirDescription<ParameterN>=<string>]
|
ID of the campaign or flight to which the banner will be added. Read also: |
|
Banner template ID. A template is a banner code with variables. It defines the appearance and functionality of the banner on the site. Please note that if the ad campaign ( You can check if a template has this attribute by getting the template parameters (account-list-template) or the list of templates in the banner type (bannerType-list-template). See list-template to find out how to get the list of template IDs. |
|
Object name. An entry can contain Russian and Latin letters, numbers, and any special characters |
|
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. For more information on how to get the list of profile IDs, see list-targetingProfile. |
|
Banner type ID. Read also: |
|
Acceptable values:
Default value: |
|
Object status. Only objects with the active status can be displayed. Acceptable values:
Default value: |
|
Get links to events. Acceptable values:
Default value: |
|
Disable banner placement on placements created after the banner was added. Acceptable values:
This option depends on whether you have enabled the “Disable banner placement” module. If the module is enabled, the default value is If the module is disabled, the default value is |
|
Background color in HEX format, for example: |
|
Banner width. |
|
Banner height. |
|
Link to the banner image or a flash banner placeholder. |
|
Link to the advertiser's website. |
|
The link's Acceptable values:
|
|
The |
|
User parameters, where N is the parameter number from 1 to 25. Every template contains a set of defined variables. Get a list of template variables used and pass values to these variables when you add or edit the banner. For example, a template has two custom parameters: strings When you add or edit the banner, you need to pass the following values:
|
|
Event names, where N is the event number from 1 to 30. Every template contains a set of defined events. Get a list of template variables used and pass event names when you add or edit the banner. |
|
Specify the click-through URL for events, where N in the parameter name is the event number from 1 to 30. |
|
Video quality. Acceptable values:
Default value: |
|
Video duration in seconds. You can set this value with millisecond precision: for example, |
|
Maximum number of banner impressions. Acceptable values: |
|
Maximum number of impressions per day. Acceptable values: |
|
Maximum number of impressions per hour. Acceptable values: |
|
Maximum number of clicks in total. Acceptable values: |
|
Maximum number of clicks per day. Acceptable values: |
|
Maximum number of clicks per hour. Acceptable values: |
|
Tracking pixel link. A pixel link usually has a variable that waits for a random number to be input. This number protects the link from caching in the browser. Adfox provides a macro for assigning a random numeric value to a variable: For example, in links to the Adfox pixel,
|
|
Delivery start date. Default value: today from 00:00. Date and time format: |
|
Delivery end date. Date and time format: |
|
Show the banner menu. Acceptable values:
Default value: |
|
Show the “Ad” or “Social ad” label on banners. Acceptable values:
Default value: |
|
Domain next to the “Ad” label. |
|
Submit data to the state register (ERIR). Acceptable values:
Default value: |
|
The banner token obtained from a third-party advertising data operator, including Yandex Advertising Data Operator via API, instead of using Adfox's standard labeling method. You can set the The Token field accepts only the token value. Don't add any other characters. |
|
Type of ad distribution. Acceptable values:
|
|
Description of the creative. |
|
Code from the KKTU reference list. Required if labeling is enabled. If To retrieve the list of codes, use the bannerKktu method. |
|
General description of the advertised item. Required if |
|
Ad impression region. Acceptable values:
|
|
ID of the ad impression region. Required if To set multiple regions, include several
To get a list of regions, use the erirRegions method. |
|
Target URL. |
|
Array of creative's text data. This field is required if the |
|
Array of creative media data. This field is required if the The The Example of the field:
|
|
Enable or disable the transfer of the creative's parameter to the state register for a specific variable, where If you're passing predefined variables, use the following parameter names:
To enable custom variables (user1-user25), use Acceptable values:
Default value: This field is required if the If parameter transfer isn't enabled in the template (the Do not use in marking option is selected in the Labeling column), you won't be able to submit the parameter (error |
|
Type of file uploaded to the variable when data transfer to the state register is enabled. Acceptable values:
If you select |
|
Description of the creative's object for the variable with the uploaded file. Required if |
* Required parameter
Response format
<response>
<status>
<code>{integer}</code>
<ID>{integer}</ID>
</status>
</response>
Response parameters
|
Request processing status. A value of |
|
Object ID. |
Sample request and response
Request:
https://adfox.yandex.com/api/v1?object=account&action=add&actionObject=banner&name=aptil2022&campaignID=444444
Response:
<response> <status> <code>0</code> <ID>456789</ID> </status> </response>
Other actions with the object
Read about other actions with the banner
object:
- Get a list of banners.
- Delete a banner.
- Edit a banner.
- Get information on banner placement.
- Edit banner placement.
- Get statistics on campaigns/banners/placements for the day.
- Target a banner by frequency.
- Target a banner by geography.
- Target a banner by keywords.
- Target a banner by gender, age, or income.
- Target a banner by user characteristics.
- Target a banner by time.
- Upload a video file to be converted in the banner.
ID of the campaign or flight that the banner will be added to.
Read also:
Object name. An entry can contain Russian and Latin letters, numbers, and any special characters
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.
For more information on how to get the list of profile IDs, see list-targetingProfile.
Banner template ID.
A template is a banner code with variables. It defines the appearance and functionality of the banner on the site.
Please note that if the ad campaign (campaignID
) to which the banner is being added was created using an impression count method (impressionsMethodID=2101
or impressionsMethodID=2102
), the template must have the is_Ims=1
attribute.
You can check if a template has this attribute by getting the template parameters (account-list-template) or the list of templates in the banner type (bannerType-list-template).
See list-template to find out how to get the list of template IDs.
Banner type ID.
Read also:
System templates.
This parameter is required if the banner template (templateID
) is not set.
Acceptable values:
XML
: An XML banner (for XML types).
Get links to events.
Acceptable values:
-
0
: disabled. -
1
: enabled.
Default value: 0
.
Get links to events.
Acceptable values:
-
0
: disabled. -
1
: enabled.
Default value: 0
.
Background color in HEX format, for example: #FFFFFF
.
Banner width.
Banner height.
Link to the banner image or a flash banner placeholder.
Link to a flash video for flash banners.
Link to the advertiser's website.
The link's target parameter determines the window where the link opens.
Acceptable values:
-
_blank
: Open the page in a new browser window. -
_parent
: Open the page in the current window. -
_top
: Open the page in a full browser window.
The alt
parameter of the img
tag provides alternative text for the image.
Name of the parameter that's used to pass the link to the flash video.
When a flash video is developed, the click-processing code uses a parameter that waits for a click-through link to be input.
You specify the click-through link and the parameter name for passing the link to the video when you add the banner to Adfox.
The parameter name in the banner must match the one in the flash video.
The name of the parameter used to pass the target
value to the flash video.
When a flash video is developed, the click processing code uses a parameter that expects the target
value in the input.
You specify the click link and the parameter name for passing the target
value to the video when adding the banner to Adfox.
The parameter name in the banner must match the one in the flash video.
User parameters, where N is the parameter number from 1 to 25.
Every template contains a set of defined variables. Get a list of template variables used and pass values to these variables when you add or edit the banner.
For example, a template has two custom parameters: strings user1
and user3
.
When you add or edit the banner, you need to pass the following values:
user1=text1&user3=text3
Event names, where N is the event number from 1 to 30.
Every template contains a set of defined events. Get a list of template variables used and pass event names when you add or edit the banner.
Specify the click-through URL for events, where N in the parameter name is the event number from 1 to 30.
Depending on the banner type: HTML code, XML code, or JavaScript.
Only for XML banners.
Specify the HTML code that shows the XML banner in the preview window.
Tracking pixel link.
A pixel link usually has a variable that waits for a random number to be input. This number protects the link from caching in the browser.
Adfox provides a macro for assigning a random numeric value to a variable: %random%
.
For example, in links to the Adfox pixel, pr
is the parameter used to insert a random number. Let's add a macro to it:
http://ads.adfox.com/166283/getCode?p1=borgd&p2=ezjv&pfb=dwsey&pr=%random%
Show the banner menu.
Acceptable values:
-
0
: Don't show the menu. -
1
: Show the menu.
Default value: 1
.
Show the “Ad” or “Social ad” label on banners.
Acceptable values:
-
0
: Disable the label. -
1
: Show the “Ad” label. -
2
: Show the “Social ad” label.
Default value: 0
.
Domain next to the “Ad” label.
Submit data to the state register (ERIR).
Acceptable values:
-
0
: Do not submit data to the state register. -
1
: Submit data to state register (labeling enabled).
Default value: 0
.
The banner token obtained from a third-party advertising data operator, including Yandex Advertising Data Operator via API, instead of using Adfox's standard labeling method.
You can set the token
parameter value only if sendToErir=0
.
The Token field accepts only the token value. Don't add any other characters.
Type of ad distribution.
Acceptable values:
-
1
: Banner. -
2
: Text & Image ad unit. -
3
: Text ad unit. -
4
: Video. -
5
: Live video. -
6
: Live audio. -
7
: Audio. -
8
: Text ad unit with video. -
9
: Text & Image ad unit with video. -
10
: Text ad unit with audio. -
11
: Text & Image ad unit with audio. -
12
: Text & Image ad unit with audio and video. -
13
: Text ad unit with audio and video. -
14
: HTML5 banner.
Video quality.
Acceptable values:
240p
360p
480p
720p
1080p
Default value: 480p
.
Video duration in seconds.
You can set this value with millisecond precision: for example, 11.325
.
List of OKVED codes for the advertised products. This field is optional if at least one of the following is true:
-
OKVED codes are specified at campaign level.
-
The client under the contract is a Russian legal entity (a resident).
Example of passing two OKVED values in a request: &okveds[]=88.33&okveds[]=77.54
.
Creative description.
Code from the KKTU reference list. Required if labeling is enabled.
If markingKktu
is set to 30.15.1
, markingCommonDescription
is required.
Changing the parameter value resubmits the banner to the state register for a review.
General description of the advertised item.
Changing the parameter value resubmits the banner to the state register for a review.
Ad impression region.
Changing the parameter value resubmits the banner to the state register for a review.
ID of the ad impression region.
Changing the parameter value resubmits the banner to the state register for a review.
Ad running start date.
Default value: today from 00:00.
Date and time format: YYYY-MM-DD HH:mm
Delivery end date.
Date and time transmission format: YYYY-MM-DD HH:mm
Target URL.
Changing the parameter value resubmits the banner to the state register for a review.
Array of creative's text data. This field is required if the mediaData
and sendToErir<ParameterN>
parameters were omitted.
Changing the parameter value resubmits the banner to the state register for a review.
Enable or disable the transfer of the creative's parameter to the state register for a specific variable, where <ParameterN>
is the name of that variable.
If you're passing predefined variables, use the following parameter names:
-
sendToErirImageURL
for the Image variable. -
sendToErirGetFLV
for the FLV video variable.
To enable custom variables (user1-user25), use <ParameterN>
, where N is a value from 1 to 25. For example, use sendToErirParameter2
for the additional variable user2.
Acceptable values:
-
0
: Disable data transfer to the state register for the variable. -
1
: Enable data transfer to the state register for the variable.
Default value: 0
.
This field is required if the mediaData
and textData
parameters were omitted.
If parameter transfer isn't enabled in the template (the Do not use in marking option is selected in the Labeling column), you won't be able to submit the parameter (error Incorrect value (-6)
). To manage data transfer when creating a banner, go to the Adfox interface and enable the option in the template.
Type of file uploaded to the variable when data transfer to the state register is enabled.
Acceptable values:
-
image
; -
video
; -
audio
; -
zip
.
If you select image
, the sendToErirDescription<ParameterN>
parameter, which describes the creative's object, becomes required.
Description of the creative's object for the variable with the uploaded file. Required if image
is specified in the sendToErirContentType<ParameterN>
parameter.
Acceptable values:
1≤N≤1000
, where N is a number from 1 to 1000 inclusive.
Default value: 100
.
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.
Default value: 0
.
Array of creative's media data. This field is required if you skipped the parameters textData`` and
sendToErir
The URL
is checked for accessibility before saving.
The description
field is optional.
Example of the field:
mediaData[]={"url": "https://avatars.mds.yandex.net/get-adfox-content/2462621/221121_adfox_2033661_5594482.379ba05374bcd6b6339273f47b5a1b64.jpeg/optimize.webp", "description": "Text_string"}
Changing the parameter value resubmits the banner to the state register for a review.
Maximum number of banner impressions.
Acceptable values: Integers from 1 to 2147483647
.
Maximum number of impressions per day.
Acceptable values: Integers from 1 to 2147483647
.
Maximum number of impressions per hour.
Acceptable values: Integers from 1 to 2147483647
.
Maximum total number of click-throughs.
Acceptable values: Integers from 1 to 2147483647
.
Maximum number of clicks per day.
Acceptable values: Integers from 1 to 2147483647
.
Maximum number of clicks per hour.
Acceptable values: Integers from 1 to 2147483647
.
* Required parameter