Ad server

Server-side rendering

Custom placements can be extended to do server-side rendering of creatives. This is useful when HTTP POST is not available to the client or there is no way of rendering the creative from JSON.

Endpoint

GET https://api.placement.advisible.com/delivery/v1/html

Authorization

An authorization token is required, which should be provided via the token query parameter. Create a new app token in Advisible Console and substitute [TOKEN] below.

Templates

Templates are created and stored in the Source Code service of the platform. Go to the Publisher account that owns the placement and create a new file, for example:

Example template
<a href="%url%">
    <label>ADVERTISEMENT</label>
    <img src="%assetUrl%">
    <h2>%headline%</h2>
    <div><span>%advertiser%</span>%lead%</div>
</a>

Then go to the placement source and link the template.

Request

The endpoint accepts a query of this type:

Request type
type HtmlQueryParams = {
    publisherId: string
    placementName: string
    token: string
    adapterId?: string
    code?: string
}

While developing the integration it can be helpful to use a preview request to get a test ad. The request below will return a generated ad using the settings on the given placement.

Example preview request
https://api.placement.advisible.com/delivery/v1/html?publisherId=12345678&placementName=newsletter&token=[TOKEN]&adapterId=com.advisible.content-display&code=generate-lorem

Omit the adapterId and code fields to make a live ad request instead.

Example live request
https://api.placement.advisible.com/delivery/v1/html?publisherId=12345678&placementName=newsletter&token=[TOKEN]

Response

The response is HTML. The integration should be able to handle between zero and the configured maximum number of items, which is configured in the placement settings. When multiple items are delivered, their HTML strings are concatenated.

Given the template above, a response could look like:

Example response
<a href="https://...">
    <label>ADVERTISEMENT</label>
    <img src="https://...">
    <h2>This is the headline</h2>
    <div><span>Test Advertiser</span>The lead for this teaser.</div>
</a>