Skip to main content
POST
Retrieve an ad (POST)

Body

application/json
ID
integer
required

Your Haku account ID.

Example:

11111

setID
integer
required

The zone ID being requested.

Example:

123456

type
string
required

Has two possible values: "json" returns the most eligible ad, while "jsonr" returns a list of all eligible ads ordered from most to least eligible.

For more information, read How to request for all eligible ads via API.

Example:

"json"

size
string

The ad size you expect to receive.

Example:

"300x200"

rf
integer

Pass the parameter ;rf=1 if you want to determine whether the ad has a destination URL to which the user will be redirected. If this parameter is present in the request, the response will contain the extra field is_redirectable.

Example:

1

kw
string[]

Required for Keyword Targeting. Allows you to pass keywords to Haku, for use with keyword targeting. Pass an array of keyword strings.

referrer
string

Required for URL Targeting. Our URL Targeting feature traditionally relies on the HTTP referrer header to know which page our ad requests were made on. However, if you're making server-side requests you can pass it to us directly in the ad request using the ;referrer= parameter.

Example:

"https://example.com"

ip
string

Required for Geographic Targeting. If you're doing server side ad requests, and you want to geographically target your campaigns, you can simply add the ip= query parameter into the request and provide the IPv4 address used for targeting.

Example:

"192.169.0.1"

ua
string

Required for Platform Targeting. The user's User Agent string.

Example:

"Roku4640X/DVP-7.70 (297.70E04154A)"

sw
integer

Required for Platform Targeting. The user's device's screen width.

Example:

1920

sh
integer

Required for Platform Targeting. The user's device's screen height.

Example:

1080

spr
integer

Required for Platform Targeting. The user's device's screen pixel ratio.

Example:

3

pid
integer

Required for Unique Delivery or Roadblocks. The pid stands for 'pageID' and is a random number that must be the same for any ad requested from the current page instance.

Example:

123456

place
integer

Required for Unique Delivery. Place represents the number of times a particular zone has been requested on a single page instance, this should be incremented each time the zone is re-requested. Starts from 0, 1, 2, and so on.

Example:

1

user_freq
object[]

Required for User Frquency Capping. An array of placement data representing how many times a given placement has been displayed to the user, and it's expiry information.

_abdk_json
object

When using Data Keys, use this parameter to pass all the key-value pairs as an object.

Example:
defer_signing
boolean

When using Beacon Signing Keys, use this parameter to defer generating hashes and timestamps such that they can be signed later with a shared key.

Example:

false

Response

default - application/json

successful operation

status
string

Indication of successful operation.

Example:

"SUCCESS"

placements
object[]