targetingAge

Target a campaign by age.

Request format

https://adfox.yandex.com/api/v1
  ? object=campaign
  & action=target
  & actionObject=targetingAge
  & objectID=<integer>
  & age=<integer>
  & ageValues=<integer>

objectID*

ID of the object that the action is performed on.

age*

Enable targeting by age.

Acceptable values:

  • 0: Disabled.
  • 1: Enabled.

ageValues*

Select the age value.

The parameter is required if age=1.

Acceptable values:

  • 1: Under 18.
  • 2: From 18 to 24.
  • 3: From 25 to 34.
  • 4: From 35 to 44.
  • 5: Over 45 (the value is deprecated, it includes values 6 and 7 automatically).
  • 6: From 45 to 54.
  • 7: Over 55.

You can pass multiple values separated with a vertical line \| without spaces.

* 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=target&actionObject=targetingAge&objectID=2783648&age=1&ageValues=1

Response:

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

Other actions with the object

See more actions with the campaign object: