# Request API: AD endpoint

The **AD endpoint** is used for integrations that can't parse a JSON response and require the response in a specific markup instead. It is typically used for [video and audio setups](https://documentation.adhese.eu/books/adhese-products/page/vast-video-audio-advertising), where ads are requested by media players and follow the [VAST](https://iabtechlab.com/standards/vast/) protocol in XML.

The API is public and requires no authentication and **cookies are not required** for an integration to work.

## Request method

The AD endpoint supports **GET requests only**. As with the GET version of the JSON endpoint, **slot-level parameters are not supported**.

<p class="callout warning">Unlike the JSON endpoint, only one placement can be retrieved with each call</p>

## URL structure

A request URL is built from the sections below, in order. Sections marked *repeatable* can appear more than once.

<div class="overflow-x-auto w-full px-2 mb-6" data-sourcepos="13:1-19:71;610-1396" id="bkmrk-section-repeatable-d"><table class="min-w-full border-collapse text-sm leading-[1.7] whitespace-normal" style="width: 100%;"><thead class="text-left"><tr><th class="text-text-100 border-b-0.5 border-[hsl(var(--border-300)/0.6)] py-2 pr-4 align-top font-bold" scope="col" style="width: 19.9021%;">Section</th><th class="text-text-100 border-b-0.5 border-[hsl(var(--border-300)/0.6)] py-2 pr-4 align-top font-bold" scope="col" style="width: 10.1337%;">Repeatable</th><th class="text-text-100 border-b-0.5 border-[hsl(var(--border-300)/0.6)] py-2 pr-4 align-top font-bold" scope="col" style="width: 69.9642%;">Description</th></tr></thead><tbody><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 19.9021%;"><code>https&#58;&#47;&#47;ads&#45;&#91;account&#93;&#46;adhese&#46;com</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 10.1337%;">No</td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 69.9642%;">The domain — either the default ads domain for your account or a configured first-party domain. See [First-party domains](#bkmrk-when-handling-errors) for more info.</td></tr><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 19.9021%;"><code>&#47;ad&#47;</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 10.1337%;">No</td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 69.9642%;">Fixed path segment that selects the AD endpoint.</td></tr><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 19.9021%;"><code>&#47;sl&#91;location code&#93;&#45;&#91;format code&#93;&#47;</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 10.1337%;">No</td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 69.9642%;">A placement (slot). Starts with the prefix <code>sl</code>, followed by the full slot code. </td></tr><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 19.9021%;"><code>&#47;ct&#91;value&#93;&#59;&#91;value&#93;&#47;</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 10.1337%;">Yes</td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 69.9642%;">A target section. Starts with its predefined prefix (e.g. <code>ct</code>) and is followed by a single value or a list of values separated by <code>&#59;</code>. Add one section per target group you want to pass.</td></tr><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 19.9021%;"><code>&#63;t&#61;&#91;timestamp&#93;</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 10.1337%;">No</td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 69.9642%;">A timestamp, used to avoid caching issues.</td></tr></tbody></table>

</div>## Example request

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

Broken down:

<div class="overflow-x-auto w-full px-2 mb-6" data-sourcepos="29:1-34:69;1511-1828" id="bkmrk-part-meaning-https%3A%2F"><table class="min-w-full border-collapse text-sm leading-[1.7] whitespace-normal"><thead class="text-left"><tr><th class="text-text-100 border-b-0.5 border-[hsl(var(--border-300)/0.6)] py-2 pr-4 align-top font-bold" scope="col">Part</th><th class="text-text-100 border-b-0.5 border-[hsl(var(--border-300)/0.6)] py-2 pr-4 align-top font-bold" scope="col">Meaning</th></tr></thead><tbody><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top"><code>https&#58;&#47;&#47;ads&#45;demo&#46;adhese&#46;com</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top">Ads domain for the <code>demo</code> account</td></tr><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top"><code>&#47;ad&#47;</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top">AD endpoint</td></tr><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top"><code>&#47;sldemo&#46;com&#95;kitchen&#45;billboard&#47;</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top">Placement: prefix <code>sl</code>, location code <code>demo&#46;com&#95;kitchen</code>, format code <code>billboard</code></td></tr><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top"><code>&#47;dtdesktop&#47;</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top">Target section: prefix <code>dt</code> with value <code>desktop</code></td></tr></tbody></table>

</div>## Response

A successful request returns the ads in the requested markup (VAST XML for video/audio setups).  
This markup is determined by the advar template used to create the banner that is returned by the request.

<p class="callout success">If no ads are available, the response contains **no ads**. This is still a successful `200` response, **not** an error.</p>

### Response codes

<div class="overflow-x-auto w-full px-2 mb-6" data-sourcepos="44:1-48:113;2081-2521" id="bkmrk-code-name-descriptio"><table class="min-w-full border-collapse text-sm leading-[1.7] whitespace-normal" style="width: 100%;"><thead class="text-left"><tr><th class="text-text-100 border-b-0.5 border-[hsl(var(--border-300)/0.6)] py-2 pr-4 align-top font-bold" scope="col" style="width: 6.67334%;">Code</th><th class="text-text-100 border-b-0.5 border-[hsl(var(--border-300)/0.6)] py-2 pr-4 align-top font-bold" scope="col" style="width: 12.7546%;">Name</th><th class="text-text-100 border-b-0.5 border-[hsl(var(--border-300)/0.6)] py-2 pr-4 align-top font-bold" scope="col" style="width: 80.5721%;">Description</th></tr></thead><tbody><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 6.67334%;"><code>200</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 12.7546%;">OK</td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 80.5721%;">The body contains the ads. If no ads are available, the response contains no ads — an empty response is a successful result, not an error.</td></tr><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 6.67334%;"><code>454</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 12.7546%;">No slots</td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 80.5721%;">The request contains no slots. The <code>x&#45;adhese&#45;bad&#45;request</code> header contains <code>slots cannot be empty</code>.</td></tr><tr><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 6.67334%;"><code>500</code></td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 12.7546%;">Internal server error</td><td class="border-b-0.5 border-[hsl(var(--border-300)/0.3)] py-2 pr-4 align-top" style="width: 80.5721%;">For a debug request, check the debug log. Otherwise, contact Adhese Support.</td></tr></tbody></table>

</div>### Error handling

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