Overview
For formats that do not work with Prebid, ServerBid offers its unified auction via API. As opposed to a Prebid auction, the API provides a pure server-to-server RTB. For that reason, API access requires a separate snippet for user syncing, which is critical to high yield.
API Setup Instructions
Description
Use the API to request an ad decision. To make a request, you must POST a JSON representation of the request.
Set the Content-Type in the header as application/json. (The API will also accept text/plain to support applications that cannot change the content type, such as older versions of IE.)
Definition
POST engine.adzerk.net/api/v2
Or to make a secure request:
POST https://engine.adzerk.net/api/v2
Arguments
Required
placements (object) | One or more Placement Objects. Required. |
divName (string | The div ID of the placement. |
networkId (int) | Always 9969 . |
siteId (int) | The ID of the site. |
adTypes[] (int array) | The ID of the ad size of the placement. Although an array, this is usually one int . |
zoneIds[] (int array) | Array of ints (not strings), though in most cases this will only be one int . Required if zone IDs were provided for the placement, should not be included if not. |
includePricingData (bool) | This is what gives back price , clearPrice , ecpm , etc. |
Optional
user.key (string) | Optional; recommended (the userkey is used when syncing with partner IDs). |
referrer (string) | Optional; recommended. ServerBid generally passes the referrer URL to RTB partners. |
ip (string) | Optional; recommended for targeting purposes. |
url (string) | Optional; highly recommended for targeting. |
enableBotFiltering (bool) | Depends on if server- or client-side. For server-side, do not include this. For client-side, you generally want to include this. |
User Syncing
The following iframe
will need to be loaded on the browser page containing the ad call - before the code doing the ad call. This is so cookies can be read and written.
HTML |
|
cURL
|
|
API Test Instructions
Below is an example JSON placement request and cURL request which should always return an ad.
API JSON Request
|
|
cURL
|
|
Below is an example response to the above request.
JSON
|
|