Skip to main content
api

Ad Request API

active
Audience: developerUpdated 2026-07-28

Exhaustive reference for the Ad Request API — every field of the request and the response. Publishers use it to request advertisements from the Binoban platform for predefined ad slots via real-time bidding (RTB).

For the step-by-step integration, see Request and render Display Ads.

Endpoint

POST {rtbPath}/api/rtb/ad

rtbPath is the host URL from your connection. This endpoint takes no authentication — do not send an Authorization header.

Headers:

  • accept: */*
  • Content-Type: application/json

Request body

FieldDescriptionTypeConstraintsMandatory
idUnique UUID to identify the requestStringUUID formatYes
adSlotIdsArray of ad slot IDs for ad placements, predefined in Binoban’s back-office (contact Binoban team for setup)Array[Integer]$int32Yes
mediaSourceDetails of the media source sending the requestObject-Yes
mediaSource.typeType of the media source (e.g., app or website)StringEnum: APP, SITEYes
mediaSource.pageUrlFull URL of the page being viewedStringmaxLength: 512No
mediaSource.versionVersion of the application (if applicable)StringmaxLength: 100No
mediaSource.pageTitleTitle of the page being viewedStringmaxLength: 255No
mediaSource.pageCategoryCategory of the pageStringmaxLength: 255No
mediaSource.pageDescriptionDescription of the pageStringmaxLength: 512No
mediaSource.pageRefReferrer URL or reference pageStringmaxLength: 512No
mediaSource.keywordsArray of keywords related to the pageArray[String]-No
mediaSource.propertiesAdditional key-value pairs for future useObjectArbitrary key-value pairsNo
deviceDevice information for the requestObject-No
device.userAgentUser agent of the deviceStringmaxLength: 512No
device.ipIP address of the deviceStringmaxLength: 45No
device.modelDevice model (e.g., iPhone 14)StringmaxLength: 100No
device.widthScreen width in pixelsInteger$int32No
device.heightScreen height in pixelsInteger$int32No
device.operatingSystemOperating system of the deviceStringEnum: ANDROID, IOS, IPOD, LINUX, WINDOWS, MACNo
device.browserBrowser used by the deviceStringEnum: CHROME, SAFARI, EDGE, INTERNET_EXPLORER, FIREFOX, CHROMIUM, FACEBOOK_IN_APP_BROWSER, WEBVIEW, SAMSUNG_BROWSER, GOOGLE_SEARCH_APP, ANDROID_APP, OPERA, MIUI_BROWSER, AMAZON_SILK, UC_BROWSER, YANDEX, APPLE_IN_APP_BROWSERNo
device.deviceTypeType of the deviceStringEnum: MOBILE, TABLET, DESKTOP, TV, CONNECTED_DEVICE, SET_TOP_BOXNo
userUser information for the requestObject-No¹
user.idDevice identifier (from Binoban SDK), critical for conversion tracking; recommended to include for accurate attributionStringmaxLength: 255No¹
user.userIdID of the logged-in userStringmaxLength: 255No¹
timeoutRequest timeout in millisecondsNumber-Yes

¹ The user.id or user.userId (or both) fields are highly recommended for conversion tracking to ensure accurate attribution. These values should be obtained from the Binoban Web SDK using Binoban.user().id() and Binoban.user().anonymousId(). See Web SDK reference → Identity for complete details.

Example request

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"adSlotIds": [
7
],
"mediaSource": {
"type": "SITE",
"pageUrl": "https://www.example.com/home",
"version": "1.0.0",
"pageTitle": "Sneaker Store Homepage",
"pageCategory": "home",
"pageDescription": "Welcome to the best sneaker store",
"pageRef": "https://www.example.com/referral",
"keywords": [
"sneakers",
"shoes"
],
"properties": {
"theme": "dark",
"region": "US"
}
},
"device": {
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1",
"ip": "192.168.1.1",
"model": "iPhone 14",
"width": 1170,
"height": 2532,
"operatingSystem": "IOS",
"browser": "SAFARI",
"deviceType": "MOBILE"
},
"user": {
"id": "device123",
"userId": "user789"
},
"timeout": 200
}

Response body (200 OK)

FieldDescriptionTypeConstraints
adsArray of advertisements for the requested ad slotsArray[Object]-
ads[].adSlotIdID of the ad slot this ad is forInteger$int32
ads[].uiAdditional UI configuration properties (arbitrary key-value pairs for rendering the ad)ObjectArbitrary key-value pairs
ads[].templateSpecific template for the ad formatStringe.g. BANNER_STICKY, NATIVE_NOTIF
ads[].bannersList of banner advertisements (present when type is BANNERS)Array[Object]-
ads[].banners[].bidIdUnique ID of the bid for tracking and analyticsStringUUID format
ads[].banners[].bannerURL of the banner imageStringmaxLength: 512
ads[].banners[].campaignIdID of the campaignInteger$int32
ads[].banners[].targetUrlThe advertiser's destination, set in their campaignStringmaxLength: 512
ads[].banners[].clickUrlTracker URL that counts the click, then redirects to targetUrlStringmaxLength: 512
ads[].banners[].titleTitle of the banner adStringmaxLength: 255
ads[].widthWidth of the ad in pixels (for banner types)Integer$int32
ads[].heightHeight of the ad in pixels (for banner types)Integer$int32
ads[].typeType of the advertisementStringEnum: BANNERS, NATIVE
ads[].nativesList of native advertisements (present when type is NATIVE)Array[Object]-
ads[].natives[].imageURL of the main image for the native adStringmaxLength: 512
ads[].natives[].titleTitle of the native adStringmaxLength: 255
ads[].natives[].bidIdUnique ID of the native ad for tracking and analyticsStringUUID format
ads[].natives[].landingUrlThe advertiser's destination, set in their campaignStringmaxLength: 512
ads[].natives[].clickUrlTracker URL that counts the click, then redirects to landingUrlStringmaxLength: 512
ads[].natives[].campaignIdID of the campaignInteger$int32
ads[].natives[].logoURL of the logoStringmaxLength: 512
ads[].natives[].iconURL of the icon for the native adStringmaxLength: 512
ads[].natives[].ctaCall to Action button textStringmaxLength: 100

Example response (200 OK)

{
"ads": [
{
"adSlotId": 1073741824,
"ui": {
"theme": "dark"
},
"template": "BANNER_STICKY",
"banners": [
{
"bidId": "550e8400-e29b-41d4-a716-446655440001",
"banner": "https://cdn.example.com/ads/banner.jpg",
"campaignId": 123456,
"targetUrl": "https://www.example.com/products/sneakers",
"clickUrl": "https://www.example.com/api/tracker/ad/click?bidId=550e8400-e29b-41d4-a716-446655440001&redirectURL=<base64 of targetUrl>",
"title": "Nike Sneakers Sale"
}
],
"width": 300,
"height": 250,
"type": "BANNERS"
},
{
"adSlotId": 1073741824,
"ui": {
"position": "bottom"
},
"template": "NATIVE_NOTIF",
"natives": [
{
"image": "https://cdn.example.com/ads/native-image.jpg",
"title": "Explore New Sneakers",
"bidId": "550e8400-e29b-41d4-a716-446655440003",
"landingUrl": "https://www.example.com/products/sneakers",
"clickUrl": "https://www.example.com/api/tracker/ad/click?bidId=550e8400-e29b-41d4-a716-446655440003&redirectURL=<base64 of landingUrl>",
"campaignId": 123457,
"logo": "https://cdn.example.com/ads/nike-logo.png",
"icon": "https://cdn.example.com/ads/icon.png",
"cta": "Shop Now"
}
],
"type": "NATIVE"
}
]
}

Notes

  • The id, adSlotIds, mediaSource.type, and timeout fields are mandatory.
  • The user.id and/or user.userId fields are highly recommended for conversion tracking to ensure accurate attribution, ideally sourced from the Binoban SDK using Binoban.user().id() and Binoban.user().anonymousId().
  • The ads array in the response contains advertisements for the requested adSlotIds. Each entry includes a type (BANNERS or NATIVE) with the corresponding banners or natives array, plus a template for specific rendering instructions.
  • The ui object can contain any additional key-value pairs needed for custom UI rendering of the ad.
  • The adSlotIds must be valid slot IDs predefined in Binoban’s back-office. Contact the Binoban team to configure ad slots.