Endpointpost /v2/decision
Parameters
placements object, required |
The placements object contains the zone ID for which you make an ad request. |
targeting object |
An object holding targeting information to fine-tune delivery to users matching your audience. |
user object |
Firt-party data about the user, like the user agent and geolocation data. Especially useful if you make server-side requests. |
deduplication object |
Deduplication makes sure the same ad is not selected more than once if you request multiple ads. |
exclude_ids object |
You can manually exclude advertisers, campaigns or ads from being served. |
Placements Object
zone_id int, required |
The ID of the zone for which you want to request and ad. Find the Zone ID in your AdFlight portal or fetch a list via the Management API. |
identifier string, required |
An identifier for the DIV or element in which you'll display the ad. |
ad_requests int, required |
The number of ads you like to request for the zone. Should be >=1. |
Targeting Object
keywords object |
A list of keywords used for targeting. This should be an array of strings. |
User Object
user_agent string |
The user-agent string of the person requesting the ad. |
language string |
The accept-language string of the person requesting the ad. |
device string |
Can be either desktop , tablet or mobile . Used for targeting. |
page_url string |
The URL on which the ad will be served. Used for reporting. |
Deduplication Object
level string |
At which level you want to deduplicate ads. Can be either advertiser , campaign or creative . |
Exclude Object
advertisers array |
An array of advertiser IDs which have to be excluded during decisioning. |
campaigns array |
An array of campaign IDs which have to be excluded during decisioning. |
creatives array |
An array of creative IDs which have to be excluded during decisioning. |
|
Example Request
{
"placements": [{
"identifier": "div1",
"zone_id": "537477984",
"ad_requests": 2 },
{
"identifier": "div2",
"zone_id": "984574737",
"ad_requests": 1 }],
"targeting": {
"keywords": ["cars", "audi"], },
"user": {
"ua": "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)",
"language": "",
"device": "desktop",
"geo": {
"country": "US",
"region": "",
"latitude": 40.730610,
"longitude": -73.935242 },
"page_url": "https://www.mypage.com" },
"deduplication": {
"level": "campaign" },
"exclude_ids": {
"advertisers": [938923838, 4329980182],
"campaigns": [],
"creatives": [] }
|