How to request for all eligible ads via API
The AdButler AdServe API lets you retrieve the most qualified ad per request. However, you can also retrieve an array of all eligible ads in one request simply by setting type to jsonr
instead of json
.
This is useful if you want to use your own process for selecting which ad to serve. The list of eligible ads is ordered from best to worst based on their placement or assignment parameters such as delivery and weight.
Sample request
GET
https://ads.domain.com/adserve/;ID=18449;size=728x90;setID=594854;type=jsonr;click=CLICK_MACRO_PLACEHOLDER
POST
https://ads.domain.com/adserve
{
"ID": 18449,
"size" : "728x90",
"setID": 594854,
"type" : "jsonr"
}
Sample response
{
"status": "SUCCESS",
"placements": [
{
"banner_id": "520976204",
"width": "728",
"height": "90",
"alt_text": "",
"accompanied_html": "",
"target": "_blank",
"tracking_pixel": "",
"body": "",
"redirect_url": "https://servedbyadbutler.com/redirect.spark?MID=184489&plid=2051715&setID=594854&channelID=0&CID=0&banID=520976204&PID=0&textadID=0&tc=1&rnd=7545984596&scheduleID=1977893&adSize=728x90&metadata=%5B%5D&mt=1721921155707273&spr=1&hc=42cfdacf2b596f5885d1defdfc7e3656a2082f77&location=",
"refresh_url": "",
"rct": "",
"rcb": "",
"refresh_time": "",
"placement_id": "2051715",
"user_frequency_views": "",
"user_frequency_start": "",
"user_frequency_expiry": "",
"image_url": "https://servedbyadbutler.com/getad.img/;libID=3774948",
"impressions_remaining": 0,
"has_quota": false
},
{
"banner_id": "522277412",
"width": "728",
"height": "90",
"alt_text": "",
"accompanied_html": "",
"target": "_blank",
"tracking_pixel": "",
"body": "",
"redirect_url": "https://servedbyadbutler.com/redirect.spark?MID=184489&plid=2529352&setID=594854&channelID=0&CID=877461&banID=522277412&PID=0&textadID=0&tc=1&rnd=7545984596&scheduleID=2447568&adSize=728x90&metadata=%5B%5D&mt=1721921155707318&spr=1&hc=91d36550f421c0ea92725ed9f584786ce2b928f8&location=",
"refresh_url": "",
"rct": "",
"rcb": "",
"refresh_time": "",
"placement_id": "2529352",
"user_frequency_views": "",
"user_frequency_start": "",
"user_frequency_expiry": "",
"image_url": "https://servedbyadbutler.com/getad.img/;libID=3770209",
"impressions_remaining": 0,
"has_quota": false
}
]
}