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
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.)
Or to make a secure request:
|One or more Placement Objects. Required.|
|The div ID of the placement.|
|The ID of the site.|
|The ID of the ad size of the placement. Although an array, this is usually one |
|Array of ints (not strings), though in most cases this will only be one |
|This is what gives back |
|Optional; recommended (the userkey is used when syncing with partner IDs).|
|Optional; recommended. ServerBid generally passes the referrer URL to RTB partners.|
|Optional; recommended for targeting purposes.|
|Optional; highly recommended for targeting.|
|Depends on if server- or client-side. For server-side, do not include this. For client-side, you generally want to include this.|
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.
API Test Instructions
Below is an example JSON placement request and cURL request which should always return an ad.
|API JSON Request
Below is an example response to the above request.