updateDefaultBanner

Add a backup ad at the banner type level. The backup ad is the banner code that's served to the user if no banner from a commercial campaign can be served now.

You can set backup ads at the placement and/or banner type level.

If the backup ad isn't set for a placement, the backup ad set for the banner type is served. If a backup ad isn't set for the banner type either, the server returns a placeholder that doesn't affect placement display on the website.

Request format

https://adfox.yandex.com/api/v1
  ? object=bannerType
  & action=updateDefaultBanner
  & objectID=<integer>
  & mode=<integer>
  & [defaultImageURL=<string>]
  & [defaultHitURL=<string>]
  & [defaultWidth=<integer>]
  & [defaultHeight=<integer>]
  & [defaultCode=<string>]
  & [defaultCodeType=<integer>]

objectID*

ID of the object that the action is performed on.

mode*

Mode for using the backup ad.

Acceptable values:

  • 0: File (only for Standard and Nondimensional banner types).
  • 1: Code.

Default value: 0.

defaultImageURL

Only for mode=0 and the Standard and Nondimensional banner types.

Backup ad image URL.

If defaultImageURL is specified, the Transition URL parameter (defaultHitURL) is required.

defaultHitURL

Only for mode=0 and the Standard and Nondimensional banner types.

Specify the URL to go to from the backup ad.

defaultWidth

Only for mode=0 and the Nondimensional banner type.

Image width in pixels.

defaultHeight

Only for mode=0 and the Nondimensional banner type.

Image height in pixels.

defaultCode

Only for mode=1 and the Nondimensional banner type.

Backup ad.

defaultCodeType

Only for mode=1.

Ad tag type.

Acceptable values:

  • 0: HTML.
  • 1: JavaScript.

Default value: 0.

* Required

Response format

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

Response parameters

code

Request processing status. For the key, see Error handling.

Sample request and response

Request:

https://adfox.yandex.com/api/v1?object=bannerType&action=updateDefaultBanner&objectID=234&mode=0

Response:

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

Other actions with the object

See more actions with the bannerType object:

ID of the object that the action is performed on.

Mode for using the backup ad.

Acceptable values:

  • 0: File (only for Standard and Nondimensional banner types).

  • 1: Code.

Default value: 0.

Only for mode=0 and the Standard and Nondimensional banner types.

Backup ad image URL.

If defaultImageURL is specified, the Transition URL parameter (defaultHitURL) is required.

Only for mode=0 and the Standard and Nondimensional banner types.

Specify the URL to go to from the backup ad.

Only for mode=0 and the Nondimensional banner type.

Image width in pixels.

Only for mode=0 and the Nondimensional banner type.

Image height in pixels.

Only for mode=1 and the Nondimensional banner type.

Backup ad.

Only for mode=1.

Ad tag type.

Acceptable values:

  • 0: HTML.

  • 1: JavaScript.

Default value: 0.

Required

Previous