banner

Clone a banner.

A new banner is created by cloning. It may inherit different sets of parameters from the original banner:

  • Banner parameters only.
  • Banner parameters and placement.
  • Banner parameters, placement, and targeting.
  • Banner parameters, placement, targeting, and limits on impressions and clicks.

The differences between the new banner and the parent banner:

  • Start date is set to the cloning date.
  • End date is reset.
  • Statistics aren't copied.

Request format

https://adfox.yandex.com/api/v1
  ? object=campaign
  & action=clone
  & actionObject=banner
  & objectID=<integer>
  & listIDs=<integer>
  & targetCampaignID=<integer>
  & cloneTypeID=<integer>
  & [name{BANNERID}=<string>]

objectID*

ID of the campaign that you want to clone the banner from.

listIDs*

ID of the banner to clone.

Use a comma to separate object IDs in the list.

targetCampaignID*

ID of the campaign to clone the banner to.

See also:

cloneTypeID*

Object cloning type.

Acceptable values:

  • 0: Only the banner content is cloned. The other settings are reset and inherited from the campaign.
  • 1: The banner content and placement settings are cloned. The other settings are reset and inherited from the campaign.
  • 2: The banner content, placement, and targeting settings are cloned. The limits on impressions and clicks are reset and inherited from the campaign.
  • 3: The banner content, placement settings, targeting, and limits are cloned.

name{BANNERID}

The parameter name {BANNERID} is the original banner ID, and the parameter value is the new banner name.

If the name isn't passed, the new banner gets the same name as the original one.

When you clone multiple banners, pass a separate name{BANNERID} parameter for every new banner.

For example: name1111=clone1&name1112=clone2.

* Required

Response format

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

Response parameters

code

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

ID

New banner ID.

message

When cloning multiple banners, some of which were created with templates that don't support loader codes, only banners with templates with the [context] tag in the name are copied, and the rest are ignored. If the message tag is present, it means that the request was only partially completed.

To check whether the template supports loader codes, use the method for getting template data. The isLoaderJs parameter must be equal to 1.

Sample request and response

Request:

https://adfox.yandex.com/api/v1?object=campaign&action=clone&actionObject=banner&objectID=562830&listIDs=1642949,1642950&targetCampaignID=562831&cloneTypeID=3&name1642949=clone1&name1642950=clone2

Response:

<response>
<status>
  <code>0</code>
  <ID>4235079,4235080</ID>
</status>
</response>

Other actions with the object

See more actions with the campaign object: