Skip to main content

Request API: AD endpoint

AD Endpoint

The AD endpoint is used for integrations that can't parse a JSON response and require the response toin bea specific markup instead. It is typically used for video and audio setups, where ads are requested by media players and follow the VAST protocol in specific markup.XML.

GETRequest requestmethod

The AD endpoint cansupports GET requests only. beAs used by using a Get request and - similar towith the GET version of the JSON endpointendpoint, - slot slot-level parameters are not supported. supported.

URL structure

TheA GETrequest versionURL ofis built from the adsections requestbelow, containsin theorder. sameSections informationmarked asrepeatable thecan POSTappear versionmore withthan one limitation:
slot level parameters are not supported.once.

Example request

https://ads-[account].adhese.com/ad/sl_sdk_example_-leaderboard/ctsports;soccer?t=244.18664863333106
section can be added more than once. Eachsection can be added more than once. Each
Section RepeatableDescription
https://ads-[account].adhese.com NoThe domain is either the default ads domain for your account or a configured first-party domain. MoreSee info on first-First-party domains canfor bemore found here.info.
/ad/ No Fixed path segment that selects the AD endpoint.
/sl[location code]-[format code]/ ThisNo A placement starts(slot). Starts with the prefix 'sl'sl, followed by the full slot code. 

/ctsports;soccer/

ct[value];[value]/
ThisYes A target sectionsection. startsStarts with its predefined prefix (e.g. ct) and is followed by eithera onesingle value or a list of values separated by ';'. Add one section per target group you want to pass.

?t=[timestamp]

NoA timestamptimestamp, used to avoid caching issuesissues.

Example request

https://ads-demo.adhese.com/ad/sldemo.com_kitchen-billboard/dtdesktop

Broken down:

PartMeaning
https://ads-demo.adhese.comAds domain for the demo account
/ad/AD endpoint
/sldemo.com_kitchen-billboard/Placement: prefix sl, location code demo.com_kitchen, format code billboard
/dtdesktop/Target section: prefix dt with value desktop

Response

A successful request returns the ads in the requested markup (VAST XML for video/audio setups).

If no ads are available, the response contains no ads. This is still a successful 200 response, not an error.

Response codes

Code Name Description
200 OK BodyThe body contains an array ofthe ads. If no ads are available, the arrayresponse iscontains emptyno ads — an empty arrayresponse is a successful response,result, not an error.
454 No slots The request body contains no slots. HeaderThe x-adhese-bad-request header contains slots cannot be empty.
500 Internal server error If this wasFor a debug request, check the debug log;log. otherwiseOtherwise, contact Adhese Support.

Error handling

When handling errors programmatically, read the x-adhese-bad-request response header for the specific error message.