banner

Edit banner parameters.

Request format

https://adfox.yandex.com/api/v1
  ? object=banner
  & action=modify
  & actionObject=banner
  & objectID=<integer>
  & [name=<string>]
  & [targetingProfileID=<integer>]
  & [dateStart=<YYYY-MM-DD HH:mm>]
  & [dateEnd=<YYYY-MM-DD HH:mm>]
  & [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>]
  & [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>]

objectID*

ID of the object that the action is performed on.

name

Banner name.

An entry can contain Russian and Latin letters, numbers, and any special characters

targetingProfileID

Targeting profile ID.

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.

dateStart

Ad running start date.

Date and time format: YYYY-MM-DD HH:mm

dateEnd

Delivery end date.

Date and time transmission format: YYYY-MM-DD HH:mm

priority

Priority.

Acceptable values:

  • 1≤N≤1000, where N is a number from 1 to 1000 inclusive.

status

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.

isEvents

Get links to events.

Acceptable values:

  • 0: disabled.
  • 1: enabled.

isUnplaced

Disable banner placement on placements created after adding the banner.

Acceptable values:

  • 0: disabled.
  • 1: enabled.

This option depends on whether you have enabled the “Disable banner placement” module.

If the module is enabled, the default value is 1.

If the module isn't connected, the default value is 0.

backgroundColor

Background color in HEX format, for example: #FFFFFF.

width

Banner width.

height

Banner height.

imageURL

Link to the banner image or a flash banner placeholder.

hitURL

Link to the advertiser's website.

target

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.

alt

The alt parameter of the img tag provides alternative text for the image.

userN

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

eventN

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.

hitURLN

Specify the click-through URL for events, where N in the parameter name is the event number from 1 to 30.

videoResolution

Video quality.

Acceptable values:

  • 240p
  • 360p
  • 480p
  • 720p
  • 1080p

Default value: 480p.

videoDuration

Video duration in seconds.

You can set this value with millisecond precision: for example, 11.325.

maxImpressions

Maximum number of impressions.

Acceptable values: Integers from 1 to 2147483647.

maxImpressionsPerDay

Maximum number of impressions per day.

Acceptable values: Integers from 1 to 2147483647.

maxImpressionsPerHour

Maximum number of impressions per hour.

Acceptable values: Integers from 1 to 2147483647.

maxClicks

Maximum total number of click-throughs.

Acceptable values: Integers from 1 to 2147483647.

maxClicksPerDay

Maximum number of clicks per day.

Acceptable values: Integers from 1 to 2147483647.

maxClicksPerHour

Maximum number of clicks per hour.

Acceptable values: Integers from 1 to 2147483647.

trackingURL

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 for assigning a random number. Let's add a macro to it:

http://ads.adfox.com/166283/getCode?p1=borgd&p2=ezjv&
pfb=dwsey&pr=%random%

showMenu

Show the banner menu.

Acceptable values:

  • 0: Don't show the menu.
  • 1: Show the menu.

adLabel

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.

domain

Domain next to the “Ad” label.

sendToErir

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).
  • When the parameter changes from 0 to 1, the object is submitted to the state register.

  • When the parameter changes from 1 to 0, ad labeling is disabled in Adfox. Previously submitted object data remain in the state register.

token

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.

creativeContentType

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.

Changing the parameter value resubmits the banner to the state register for a review.

markingDescription

Description of the creative.

Changing the parameter value resubmits the banner to the state register for a review.

markingKktu

Code from the KKTU reference list. Required if labeling is enabled. If markingKktu is set to 30.15.1, markingCommonDescription is required.

To get the list of codes, use the bannerKktu method.

Changing the parameter value resubmits the banner to the state register for a review.

markingCommonDescription

General description of the advertised item. Required if 30.15.1 is specified in the markingKktu parameter.

Changing the parameter value resubmits the banner to the state register for a review.

markingSendRegionsType

Ad impression region.

Acceptable values:

  • none: Don't send value — the impression region data isn't sent to ERIR.
  • all: All Russia value — the banner is served in all regions of Russia.
  • selected: Specify regions manually value. If you choose selected, be sure to provide the IDs of the selected regions in the markingSelectedRegions parameter.

Changing the parameter value resubmits the banner to the state register for a review.

markingSelectedRegions

ID of the ad impression region. Required if selected is specified in the markingSendRegionsType parameter.

To set multiple regions, include several markingSendRegionsType's in the request parameters. Example for ad impression regions with codes 9, 21, and 63:

&markingSendRegionsType=9&markingSendRegionsType=21&markingSendRegionsType=63

To get the list of regions, use the erirRegions method.

Changing the parameter value resubmits the banner to the state register for a review.

targetURL

Target URL.

Changing the parameter value resubmits the banner to the state register for a review.

textData[]

Array of creative's text data. This field is required if the mediaData and sendToErir<ParameterName> parameters were omitted.

To add an array element, pass all existing elements along with the new ones.

To delete an element from the array, pass all the elements except the one that you want to delete.

You can also completely clear the array. To do this, pass an array with an empty value, for example: textData[]=.

Changing the parameter value resubmits the banner to the state register for a review.

mediaData[]

Array of creative's media data. This field is required if the textData and sendToErir<ParameterName> parameters were omitted.

The URL is checked for availability before saving.

The description field is optional.

Example of the field:

mediaData[]={"url": "https://avatars.mds.yandex.net/
get-adfox-content/example.jpeg/example.we
bp", "description": "Text_string"}

To add an array element, pass all existing elements along with the new ones.

To delete an element from the array, pass all the elements except the one that you want to delete.

You can also completely clear the array. To do this, pass an array with an empty value, for example: mediaData[]=.

Changing the parameter value resubmits the banner to the state register for a review.

sendToErir<ParameterN>

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 submission to the state register for the variable.

Changing the parameter value resubmits the banner to the state register for a review.

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.

sendToErirContentType<ParameterN>

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.

Changing the parameter value resubmits the banner to the state register for a review.

sendToErirDescription<ParameterN>

Description of the creative's object for the variable with the uploaded file. Required if image is specified in the sendToErirContentType<ParameterN> parameter.

Changing the parameter value resubmits the banner to the state register for a review.

* Required parameter

Response format

<response>
<status>
  <code>{integer}</code>
</status>
</response>

Response parameters

code

Request processing status. A value of 0 means the request was completed successfully. For the key, see Error handling.

Sample request and response

Request:

https://adfox.yandex.com/api/v1?object=banner&action=modify&actionObject=banner&objectID=234532

Response:

<response>
<status>
  <code>0</code>
</status>
</response>

Other actions with the object

Read also about other actions with the banner object:

ID of the object that the action is performed on.

Banner name.

An entry can contain Russian and Latin letters, numbers, and any special characters.

Banner name.

An entry can contain Russian and Latin letters, numbers, and any special characters.

Delivery start date.

Date and time format: YYYY-MM-DD HH:mm.

Delivery end date.

Date and time format: YYYY-MM-DD HH:mm.

Priority.

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.

Get links to events.

Acceptable values:

  • 0: Disabled.

  • 1: Enabled.

Disable the banner on placements created after adding the banner.

Acceptable values:

  • 0: Disabled.

  • 1: Enabled.

The features depend on whether you connected the "Disable banner placement" module in the account.

Default value: 1. If the module is connected.

Default value: 0. If the module isn't connected.

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 target parameter for the link 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 value for the img tag represents an 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 link to be input.

You specify the click 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.

Name of the parameter that's used to pass the target value to the flash video.

When a flash video is developed, the click-processing code uses a parameter that waits for the target value to be input.

You specify the click link and the parameter name for passing the target value to the video when you add 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 user parameters: user1 and user3 with the string data type.

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 URL for events, where N in the parameter name is the event number from 1 to 30.

Maximum number of banner impressions.

Acceptable values: an integer from 1 to 2,147,483,647.

Maximum number of impressions per day.

Acceptable values: an integer from 1 to 2,147,483,647.

Maximum number of impressions per hour.

Acceptable values: an integer from 1 to 2,147,483,647.

Maximum total number of clicks.

Acceptable values: an integer from 1 to 2,147,483,647.

Maximum number of clicks per day.

Acceptable values: an integer from 1 to 2,147,483,647.

Maximum number of clicks per hour.

Acceptable values: an integer from 1 to 2,147,483,647.

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.

In Adfox, there's a macro for substituting a random number to a variable: %random%.

For example, in links to the Adfox pixel, pr is the parameter for substituting 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 menu on the banner.

Acceptable values:

  • 0: Don't show the menu.

  • 1: Show the menu.

Default value: 0.

Show the “Ad” or the “Social Ad” label on the banner.

Acceptable values:

  • 0: The “Ad” label is disabled.

  • 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).

  • When the parameter changes from 0 to 1, the object is submitted to the state register.

  • When the parameter changes from 1 to 0, ad labeling is disabled in Adfox. Previously submitted object data remain in the state register.

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.

Changing the parameter value resubmits the banner to the state register for a review.

Description of the creative's object for the variable with the uploaded file. Required if image is specified in the sendToErirContentType<ParameterN> parameter.

Changing the parameter value resubmits the banner to the state register for a review.

Token of the banner what was received from a third-party advertising data operator (ORD) including Yandex advertising data operator (Yandex ORD) by API (not through the standard marking Adfox mechanism).

You can specify the token parameter value only if sendToErir=0.

To the Token field you can only add a token's value. Don't add other symbols.

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.

Changing the parameter value resubmits the banner to the state register for a review.

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.

Description of a creative.

Changing the parameter value resubmits the banner to the state register for a review.

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.

Target URL.

Changing the parameter value resubmits the banner to the state register for a review.

Target URL.

Changing the parameter value resubmits the banner to the state register for a review.

Array with media data of creatives. The field is required if the textData and sendToErir<ParameterN> parameters haven't been specified.

URL: The link is checked for availability before saving.

The description field is optional.

Example:


mediaData[]={"url": "https://avatars.mds.yandex.net/get-adfox-content/2462621/221121_adfox_2033661_5594482.379ba05374bcd6b6339273f47b5a1b64.jpeg/optimize.webp", "description": "Text_string"}

To add an element, submit all previously used and all new elements.

If you want to delete an element from the array, submit all elements except the one that you need to delete.

You can also clear the array completely. To do this, submit an array with an empty value, for example, mediaData[]=.

Changing the parameter value resubmits the banner to the state register for a review.

Enable/disable submitting a parameter (creative) value to the Russian state register for a certain variable. Where <ParameterN> is the name of the variable.

If you submit 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 submitting data to the Russian state register for the variable.

  • 1: Enable submitting data to the Russian state register for the variable.

Changing the parameter value resubmits the banner to the state register for a review.

The field is required if the mediaData and textData parameters haven't been specified.

If the parameter submission option is not enabled for the template (the Do not use in marking option is selected in the Marking column), the parameter won't be submitted (the Incorrect value (-6) error will occur). To manage data submission when creating a banner, go to the Adfox interface and enable the option in the template.

Required

Previous
Next