template

Get data about template parameters.

Request format

https://adfox.yandex.com/api/v1
  ? object=account
  & action=list
  & actionObject=template
  & actionObjectID=<integer>

actionObjectID*

Specify the template ID.

* Required

Response format

<response>
<status>
  <code>{integer}</code>
</status>
<result>
  <rows>1</rows>
<data>
  <row0>
    <id>{integer}</id>
    <name>{string}</name>
    <ownerID>{integer}</ownerID>
    <description>{string}</description>
    <isZipAllowed>{integer}</isZipAllowed>
    <isLoaderJs>{integer}</isLoaderJs>
    <isMultipleTrackingUrl>{integer}</isMultipleTrackingUrl>
    <isBackgroundColor>{integer}</isBackgroundColor>
    <isWidth>{integer}</isWidth>
    <widthDefault>{integer}</widthDefault>
    <isHeight>{integer}</isHeight>
    <heightDefault>{integer}</heightDefault>
    <isGetUrl>{integer}</isGetUrl>
    <getUrlWidth>{integer}</getUrlWidth>
    <getUrlHeight>{integer}</getUrlHeight>
    <isGetFlv>{integer}</isGetFlv>
    <isImageUrl>{integer}</isImageUrl>
    <imageUrlWidth>{integer}</imageUrlWidth>
    <imageUrlHeight>{integer}</imageUrlHeight>
    <isHitUrl>{integer}</isHitUrl>
    <isTarget>{integer}</isTarget>
    <isAlt>{integer}</isAlt>
    <isFlashParameterName>{integer}</isFlashParameterName>
    <isTargetParameterName>{integer}</isTargetParameterName>
    <isTrackingUrl>{integer}</isTrackingUrl>
    <codeType>{integer}</codeType>
    <impressionCode>{string}</impressionCode>
    <markingSettings>{integer}</markingSettings>
    <isIms>{integer}</isIms>
    <userParameters>
      <row0>
        <userParameterID>{integer}</userParameterID>
        <isOn>{integer}</isOn>
        <name>{string}</name>
        <isRequired>{integer}</isRequired>
        <type>{string}</type>
        <length>{integer}</length>
        <default>{string}</default>
        <fileTypeID>{integer}</fileTypeID>
        <width>{string}</width>
        <height>{string}</height>
        <upload_domain>{string}</upload_domain>
      </row0>
       ...
      <row24>
        ...
      </row24>
    </userParameters>
      <events>
        <row0>
          <eventID>{integer}</eventID>
          <name>{string}</name>
          <limitSession>{integer}</limitSession>
        </row0>
          ...
        <row29>
          ...
        </row29>
      </events>
    <templateCreatives>
      <row0>
        <field>{string}</field>
        <type>{string}</type>
      </row0>
      <row1>
        <field>{string}</field>
        <type>{string}</type>
      </row1>
      <rowN>
       ...
      </rowN>
    </templateCreatives>
      </row0>
</data>
</result>
</response>

Response parameters

code

Request processing status. If the value is 0, the request was completed successfully. For the key, see Error handling.

rows

Number of items in the response tree.

rowN

Item number in the response tree, where N is a number from 0 to rows-1 (where rows is the total number of items in the response).

ID

Unique template ID.

name

Name of the template.

ownerID

Account ID.

description

Template description.

isZipAllowed

Downloading archives is allowed.

isLoaderJs

The template works with ad tags with a loader.

isMultipleTrackingUrl

Adding multiple tracking pixels.

isBackgroundColor

The Background color variable is enabled.

isWidth

The Width variable is enabled.

widthDefault

The banner width value is set.

isHeight

The Height variable is enabled.

heightDefault

The banner height value is set.

isGetUrl

The Flash video variable is enabled.

getUrlWidth

The flash video width value is set.

getUrlHeight

The flash video height value is set.

isGetFlv

The FLV video variable is enabled.

isImageUrl

The Image variable is enabled.

imageUrlWidth

The image width value is set.

imageUrlHeight

The image height value is set.

isHitUrl

The Transition URL variable is enabled.

isTarget

The Link "TARGET" variable is enabled.

isAlt

The Image "ALT" variable is enabled.

isFlashParameterName

The Click-through transfer parameter variable is enabled.

isTargetParameterName

The "target" transmission parameter variable is enabled.

isTrackingUrl

The Tracking pixel link variable is enabled.

codeType

Template code type: 0 — HTML, 1 — JavaScript.

impressionCode

Template code.

markingSettings

The “Ad label” section is enabled to allow configuring the label when creating a banner.

isIms

Acceptable values:

  • 0: The template doesn't contain "IMS" events. You can use it to create banners in campaigns with impression count methods other than IMS.
  • 1: The template supports "IMS" events. You can use it to create banners in campaigns with "IMS" impression count methods.

userParameters

Additional variables from 1 to 25.

userParameterID

Additional variable ID.

isOn

Additional variable is enabled.

name

Name of the additional variable.

isRequired

Mandatory indication of the additional variable value.

type

Additional variable type: string, text, or file.

length

Value length of the additional variable.

default

Default value for the additional variable.

fileTypeID

File type of the additional variable: 0 — not specified, 1 — image, 2 — flash video, 3 — FLV video.

width

Width for the additional variable file.

height

Height for the additional variable file.

upload_domain

Domain for uploading files for the additional variable.

events

Events from 1 to 30.

templateCreatives.rowN.field

Banner parameter whose value can be used as a creative.

templateCreatives.rowN.type

Creative type:

  • creativeTextData: The parameter value will be submitted to the Russian state register as a text field.
  • creativeMediaData: The parameter value will be submitted to the Russian state register as a link to the creative. Before the file is saved, the URL is checked for file availability.

eventID

Event ID.

name

Event name.

limitSession

Session limit.

Sample request and response

Request:

https://adfox.yandex.com/api/v1?object=account&action=list&actionObject=template&actionObjectID=4256

Response:

<response>
<status>
  <code>0</code>
</status>
<result>
  <rows>1</rows>
<data>
  <row0>
    <id>119742</id>
    <name>Banner HTML5 [context] copy 1</name>
    <ownerID>392990</ownerID>
    <description/>
    <isZipAllowed>1</isZipAllowed>
    <isLoaderJs>1</isLoaderJs>
    <isMultipleTrackingUrl/>
    <isBackgroundColor/>
    <isWidth>1</isWidth>
    <widthDefault/>
    <isHeight>1</isHeight>
    <heightDefault/>
    <isGetUrl>0</isGetUrl>
    <getUrlWidth/>
    <getUrlHeight/>
    <isGetFlv>1</isGetFlv>
    <isImageUrl>1</isImageUrl>
    <imageUrlWidth>0</imageUrlWidth>
    <imageUrlHeight>0</imageUrlHeight>
    <isHitUrl>1</isHitUrl>
    <isTarget>1</isTarget>
    <isAlt>0</isAlt>
    <isFlashParameterName>0</isFlashParameterName>
    <isTargetParameterName>0</isTargetParameterName>
    <isTrackingUrl>1</isTrackingUrl>
    <codeType>2</codeType>
    <impressionCode>global.banner_html_json</impressionCode>
    <markingSettings>1</markingSettings>
    <isIms>1</isIms>
    <userParameters>
      <row0>
        <userParameterID>1</userParameterID>
        <isOn>1</isOn>
        <name>Transition URL</name>
        <isRequired>0</isRequired>
        <type/>
        <length>0</length>
        <default/>
        <fileTypeID>0</fileTypeID>
        <width/>
        <height/>
        <upload_domain/>
      </row0>
       ...
      <row24>
        ...
      </row24>
    </userParameters>
      <events>
        <row0>
          <eventID>123</eventID>
          <name>Site</name>
          <limitSession>1</limitSession>
        </row0>
          ...
        <row29>
          ...
        </row29>
      </events>
    <templateCreatives>
      <row0>
        <field>imageURL</field>
        <type>creativeMediaData</type>
      </row0>
      <row1>
        <field>user1</field>
        <type>creativeTextData</type>
      </row1>
      <rowN>
       ...
      </rowN>
    </templateCreatives>
      </row0>
</data>
</result>
</response>

Other actions with the object

See more actions with the actionObjectID object: