targetingTime

Target a campaign on the placement by time.

Request format

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

objectID*

ID of the object that the action is performed on.

placeID*

Placement ID.

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=campaign&action=targetPlace&actionObject=targetingTime&objectID=474205&placeID=345&isRedefined=1

Response:

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

Other actions with the object

See more actions with the campaign object:

ID of the object that the action is performed on.

Placement ID.

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.

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