targetingTime

Target a banner by time.

You can use targeting by time to limit campaign impressions to certain days of the week or times of the day, including taking into account the user's time zone.

Request format

https://adfox.yandex.com/api/v1
  ? object=banner
  & action=target
  & actionObject=targetingTime
  & objectID=<integer>
  & isRedefined=<integer>
  & [mode=<integer>]
  & [hourNdayM=<integer>]
  & [dayN=<integer>]

objectID*

ID of the object that the action is performed on.

isRedefined*

Redefine targeting.

Acceptable values:

  • 0: Inherit targeting settings from a higher level. Level hierarchy from top to bottom:

    • Campaign.
    • Campaign on the site.
    • Campaign in the site section.
    • Campaign on the placement.
    • Banner.
  • 1: Cancel targeting settings at higher levels and use the settings of the current level.

mode

Targeting options: by day of the week or by day of the month.

Acceptable values:

  • 0: by day of the week.
  • 1: by day of the month.

Default value: 0.

hourNdayM

Enable targeting by day of the week or by hour, where:

  • N: An hour from 0 to 23. For example: 0 — from 00:00 to 00:59, 1 — from 01:00 to 01:59.
  • M: A day of the week from 1 to 7. For example: 1 — Monday, 2 — Tuesday, 3 — Wednesday.

Acceptable values:

  • 0: Disable.
  • 1: Enable.

dayN

Enable targeting by day of the month, where N is the number of the day of the month, for example: 1 is the first day of the month, 2 is the second day of the month.

Acceptable values:

  • 0: Disable.
  • 1: Enable.

* 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=banner&action=target&actionObject=targetingTime&objectID=474205&isRedefined=1

Response:

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

Other actions with the object

See more actions with the banner object:

Enable targeting by day of the month, where N is the number of the day of the month, for example: 1 is the first day of the month, 2 is the second day of the month.

Acceptable values:

  • 0: Disable.

  • 1: Enable.

Required

ID of the object that the action is performed on.

Redefine targeting.

Acceptable values:

  • 0: Inherit targeting settings from a higher level. Level hierarchy from top to bottom:

    • Campaign.
    • Campaign on the site.
    • Campaign in the site section.
    • Campaign on the placement.
    • Banner.
  • 1: Cancel targeting settings at higher levels and use the settings of the current level.

Targeting options: by day of the week or by day of the month.

Acceptable values:

  • 0: by day of the week.

  • 1: by day of the month.

Default value: 0.

Enable targeting by day of the week or by hour, where:

  • N: An hour from 0 to 23. For example: 0 — from 00:00 to 00:59, 1 — from 01:00 to 01:59.

  • M: A day of the week from 1 to 7. For example: 1 — Monday, 2 — Tuesday, 3 — Wednesday.

Acceptable values:

  • 0: Disable.

  • 1: Enable.