Decision API

Error Handling

Message Reason(s)
Out of n% placements on the request, none were valid - The siteId has been deleted
- The siteId is not active
- No siteId on the request
Keywords must be an array or string Keywords are not a string or an array of strings
invalid JSON JSON is not valid
Request received with no placements defined The placements object or the request body is missing
No sites found Invalid SiteId provided in the request
Count must be an integer in the interval [1, 20] placements.count in the request is not between 1 and 20
Event multiplier must be an integer in the interval [1, 100000000] placements.eventMultiplier in the request is not between 1 and 100000000

Request Structure

Example Request

curl -H 'Content-Type:application/json' \
  -X POST \
  -d '{"user":{"key":"abc"}, "placements":[{"divName":"div0", "networkId":23, "siteId":667480, "adTypes":[5]}]}' \
  https://e-23.adzerk.net/api/v2

Example Response

{
  "user": {
    "key": "abc"
  },
  "decisions": {
    "div0": {
      "adId": 1111,
      "creativeId": 2222,
      "flightId": 3333,
      "campaignId": 4444,
      "advertiserId": 5555,
      "priorityId": 6666,
      "clickUrl": "https://e-23.adzerk.net/r?...",
      "contents": [{
        "type": "html",
        "body": "<a href='...'><img src='https://static.adzerk.net/Advertisers/cat.jpg' title='ZOMG A CAT' width='350' height='350'></a>",
        "template": "image",
        "data": {
          "imageUrl": "https://static.adzerk.net/cat.jpg",
          "title": "ZOMG A CAT",
          "width": 350,
          "height": 350,
          "customData": {
            "headline": "Test Headline",
            "cta": "Download Here"
          }
        }
      }],
      "impressionUrl": "https://e-23.adzerk.net/i.gif?...",
      "events": [
        {"id": 12, "url": "https://e-23.adzerk.net/e.gif?..."},
        {"id": 13, "url": "https://e-23.adzerk.net/e.gif?..."},
        {"id": 14, "url": "https://e-23.adzerk.net/e.gif?..."}
      ],
      "pricing": {
        "price": 5,
        "clearPrice": 2.01,
        "revenue": 0.002,
        "rateType": 2,
        "eCPM": 5
      }
    }
  },
  "candidateRetrieval": {
    "div0": {
      "candidatesFoundCount": 1
    }
  }
}