ADNUNTIUS
Search…
HTTP
We provide an HTTP API for requesting ads from our delivery server. This API may be used, for example, to enable server-side fetching of ads.

Usage

GET Requests

1
GET https://delivery.adnuntius.com/i{{params}}
Copied!
Parameter
Required?
Example value(s)
Default Value
Description
auId
Yes, unless making a POST request (see below)
ab123456789 (string)
None
The Tag ID for the Ad Unit to fetch ads from
tzo
No
-120 (number)
0
Timezone, offset from UTC in minutes
userId
No
ab123456789 (string)
If not provided, this value will be read from the Adnuntius cookie
Identifies a unique user; used for segment targeting, rate limiting, and unique user counting
siteId
No
ab123456789 (string)
None
A unique identifier for the site where the ad will be shown. This will be used, if required by your DMP, for segment targeting
tt
No
composed, multi, vast2
None
The Tag Type. The composed and multi tag-types can only be used with a POST request (see below)
format
No
html, xml, json, image, email (string)
html
Specifies the format of the returned ads

Post Requests

1
POST https://delivery.adnuntius.com/i{{params}}
Copied!
The parameters listed above in the Get Requests section are also supported on POST requests.

POST Body

Parameter
Example value
Description
adUnits
-
An array of objects for the adunits that you wish to request.
auId
ab123456789 (string)
The ad unit tag id in question.
targetId
adn-123456789 (string)
The id of the HTML element you wish your ad to be placed in.
Example POST Body:
1
{
2
"adUnits":[
3
{
4
"auId":"abc123",
5
"targetId":"adn-abc123"
6
},
7
{
8
"auId":"xyz987",
9
"targetId":"adn-xyz987"
10
}
11
]
12
}
Copied!

Examples

GET request

Request

1
GET http://delivery.adnuntius.com/i?tzo=-120&auId=abc123&userId=xyz987
Copied!

Response

1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<style type="text/css" media="all">
6
html, body, #responseCtr {
7
margin: 0;
8
padding: 0;
9
outline: 0;
10
border: 0;
11
overflow: hidden;
12
}
13
#responseCtr {
14
display: inline-block;
15
line-height: 0;
16
vertical-align: top;
17
}
18
#responseCtr a {
19
line-height: 0;
20
}
21
#responseCtr *, #responseCtr a * {
22
line-height: normal;
23
}
24
#responseCtr .adWrapper {
25
margin: 0;
26
padding: 0;
27
outline: 0;
28
border: 0;
29
display: inline-block;
30
line-height: 0;
31
}
32
a img {
33
border: none;
34
outline: none;
35
}
36
img {
37
margin: 0;
38
padding: 0;
39
}
40
/* need this displayNone class to ensure images are preloaded for smooth transition */
41
img.displayNone {
42
position: absolute;
43
top: -99999px;
44
left: -99999px;
45
}
46
</style>
47
<script type="text/javascript" src="https://cdn.adnuntius.com/adn.js"></script>
48
</head>
49
<body>
50
<div id="responseCtr" class="responseCtr">
51
<div class="adWrapper" id="adn-id-387286962" data-line-item-id="xxxxxxx" data-creative-id="xxxxxx" data-response-token="yyyyy"><a rel="nofollow" target="_top" href="https://delivery.adnuntius.com/c/yyyyy?ct&#x3D;2501&amp;r&#x3D;http%3A%2F%2Fadnuntius.com" style="width: 100%">
52
<img src="//assets.adnuntius.com/creative.jpg" style="width: 100%; max-width: 980px; margin: 0 auto; display: block;" alt=""/>
53
</a>
54
55
<script>
56
adn.util.forEach(document.getElementsByClassName("adWrapper"), function(el) {
57
el.style.width = "100%";
58
});
59
var iframeId = adn.inIframe.getIframeId();
60
var container = document.getElementById('responseCtr')
61
container.style.width = "100%"
62
var responsiveIframe = function(){
63
adn.inIframe.updateAd({
64
ifrH: container.offsetHeight,
65
ifrStyle:{width: '100%', 'min-width':'100%', '*width':'100%' },
66
ifrId: iframeId
67
});
68
}
69
adn.inIframe.getAdRequestInfo({
70
onInfoReceived: function(data) {
71
console.log("onData", data);
72
}
73
});
74
window.onresize = function(){ responsiveIframe() }
75
window.onload = function(){ responsiveIframe() }
76
adn.inIframe.blockResizeToContent();
77
</script>
78
<div style="clear: both"></div></div>
79
</div>
80
<iframe src="https://delivery.adnuntius.com/b/yyyyyy.html" scrolling="no" frameborder="0" width="1" height="1" style="position:absolute;top:-10000px;left:-100000px;"></iframe>
81
<script type="text/javascript">
82
//<![CDATA[
83
(function() { adn.inIframe.processAdResponse({ matchedAdCount: 1 }); })();
84
//]]>
85
</script>
86
</body>
87
</html>
Copied!

POST request

Request

1
POST http://delivery.adnuntius.com/i?tzo=-120&userId=xyz987&tt=composed
Copied!
POST Body:
1
{
2
"adUnits":[
3
{
4
"auId":"abc123",
5
"targetId":"adn-abc123"
6
},
7
{
8
"auId":"xyz987",
9
"targetId":"adn-xyz987"
10
}
11
]
12
}
Copied!

Response

1
{
2
"adUnits": [
3
{
4
"auId": "abc123",
5
"targetId": "adn-abc123",
6
"html": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <style type=\"text/css\" media=\"all\">\n html, body, #responseCtr {\n margin: 0;\n padding: 0;\n outline: 0;\n border: 0;\n overflow: hidden;\n }\n\n #responseCtr {\n display: inline-block;\n line-height: 0;\n vertical-align: top;\n }\n\n #responseCtr a {\n line-height: 0;\n }\n\n #responseCtr *, #responseCtr a * {\n line-height: normal;\n }\n\n #responseCtr .adWrapper {\n margin: 0;\n padding: 0;\n outline: 0;\n border: 0;\n display: inline-block;\n line-height: 0;\n }\n\n a img {\n border: none;\n outline: none;\n }\n\n img {\n margin: 0;\n padding: 0;\n }\n\n /* need this displayNone class to ensure images are preloaded for smooth transition */\n img.displayNone {\n position: absolute;\n top: -99999px;\n left: -99999px;\n }\n </style>\n\n <script type=\"text/javascript\" src=\"https://cdn.adnuntius.com/adn.js\"></script>\n</head>\n<body>\n<div id=\"responseCtr\" class=\"responseCtr\">\n<div class=\"adWrapper\" id=\"adn-id-xxxx\" data-line-item-id=\"xxxxx\" data-creative-id=\"aaaaa\" data-response-token=\"yyyyyy\"><a rel=\"nofollow\" target=\"_top\" href=\"https://delivery.adnuntius.com/c/yyyyy?ct&#x3D;2501&amp;r&#x3D;http%3A%2F%2Fadnuntius.com\" style=\"width: 100%\">\n<img src=\"//assets.adnuntius.com/creative.jpg\" style=\"width: 100%; max-width: 980px; margin: 0 auto; display: block;\" alt=\"\"/>\n</a>\n\n<script>\n\tadn.util.forEach(document.getElementsByClassName(\"adWrapper\"), function(el) {\n \tel.style.width = \"100%\";\n });\n\tvar iframeId = adn.inIframe.getIframeId();\n\tvar container = document.getElementById('responseCtr')\n container.style.width = \"100%\"\n\tvar responsiveIframe = function(){\n adn.inIframe.updateAd({\n \tifrH: container.offsetHeight,\n ifrStyle:{width: '100%', 'min-width':'100%', '*width':'100%' },\n ifrId: iframeId\n });\n\t}\n \n adn.inIframe.getAdRequestInfo({\n onInfoReceived: function(data) {\n console.log(\"onData\", data);\n }\n});\n\n\n\n\twindow.onresize = function(){ responsiveIframe() }\n\twindow.onload = function(){ responsiveIframe() }\n adn.inIframe.blockResizeToContent();\n</script>\n\n<div style=\"clear: both\"></div></div>\n</div>\n\n \n \n \n \n \n<iframe src=\"https://delivery.adnuntius.com/b/yyyyy.html\" scrolling=\"no\" frameborder=\"0\" width=\"1\" height=\"1\" style=\"position:absolute;top:-10000px;left:-100000px;\"></iframe>\n \n \n<script type=\"text/javascript\">\n//<![CDATA[\n(function() { adn.inIframe.processAdResponse({ matchedAdCount: 1 }); })();\n//]]>\n</script>\n\n \n\n</body>\n</html>",
7
"matchedAdCount": 1,
8
"rts": [
9
"yyyyyy"
10
]
11
}
12
{
13
"auId": "xyz987",
14
"targetId": "adn-xyz987",
15
"html": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <style type=\"text/css\" media=\"all\">\n html, body, #responseCtr {\n margin: 0;\n padding: 0;\n outline: 0;\n border: 0;\n overflow: hidden;\n }\n\n #responseCtr {\n display: inline-block;\n line-height: 0;\n vertical-align: top;\n }\n\n #responseCtr a {\n line-height: 0;\n }\n\n #responseCtr *, #responseCtr a * {\n line-height: normal;\n }\n\n #responseCtr .adWrapper {\n margin: 0;\n padding: 0;\n outline: 0;\n border: 0;\n display: inline-block;\n line-height: 0;\n }\n\n a img {\n border: none;\n outline: none;\n }\n\n img {\n margin: 0;\n padding: 0;\n }\n\n /* need this displayNone class to ensure images are preloaded for smooth transition */\n img.displayNone {\n position: absolute;\n top: -99999px;\n left: -99999px;\n }\n </style>\n\n <script type=\"text/javascript\" src=\"https://cdn.adnuntius.com/adn.js\"></script>\n</head>\n<body>\n<div id=\"responseCtr\" class=\"responseCtr\">\n<div class=\"adWrapper\" id=\"adn-id-xxxx\" data-line-item-id=\"xxxxx\" data-creative-id=\"aaaaa\" data-response-token=\"yyyyyy\"><a rel=\"nofollow\" target=\"_top\" href=\"https://delivery.adnuntius.com/c/yyyyy?ct&#x3D;2501&amp;r&#x3D;http%3A%2F%2Fadnuntius.com\" style=\"width: 100%\">\n<img src=\"//assets.adnuntius.com/creative.jpg\" style=\"width: 100%; max-width: 980px; margin: 0 auto; display: block;\" alt=\"\"/>\n</a>\n\n<script>\n\tadn.util.forEach(document.getElementsByClassName(\"adWrapper\"), function(el) {\n \tel.style.width = \"100%\";\n });\n\tvar iframeId = adn.inIframe.getIframeId();\n\tvar container = document.getElementById('responseCtr')\n container.style.width = \"100%\"\n\tvar responsiveIframe = function(){\n adn.inIframe.updateAd({\n \tifrH: container.offsetHeight,\n ifrStyle:{width: '100%', 'min-width':'100%', '*width':'100%' },\n ifrId: iframeId\n });\n\t}\n \n adn.inIframe.getAdRequestInfo({\n onInfoReceived: function(data) {\n console.log(\"onData\", data);\n }\n});\n\n\n\n\twindow.onresize = function(){ responsiveIframe() }\n\twindow.onload = function(){ responsiveIframe() }\n adn.inIframe.blockResizeToContent();\n</script>\n\n<div style=\"clear: both\"></div></div>\n</div>\n\n \n \n \n \n \n<iframe src=\"https://delivery.adnuntius.com/b/yyyyy.html\" scrolling=\"no\" frameborder=\"0\" width=\"1\" height=\"1\" style=\"position:absolute;top:-10000px;left:-100000px;\"></iframe>\n \n \n<script type=\"text/javascript\">\n//<![CDATA[\n(function() { adn.inIframe.processAdResponse({ matchedAdCount: 1 }); })();\n//]]>\n</script>\n\n \n\n</body>\n</html>",
16
"matchedAdCount": 1,
17
"rts": [
18
"zzzzzz"
19
]
20
}
21
],
22
"metaData": {
23
"network!usi": "aaaa",
24
"network!sessionId": "bbbb"
25
},
26
"duplicateFilter": "ccccc",
27
"segments": [],
28
"keywords": []
29
}
Copied!

Targeting Parameters

You can include targeting information with the HTTP request to the ad server that can control which line items or creatives match your request.

Key-value targeting

Key values can be sent to the ad server through HTTP like this:
1
http://delivery.adnuntius.com/i?tzo=-120&auId=00000000000481f7&kv=%5B%7B%22myKey%22%3A%5B%22myValue1%22%2C%22myValue2%22%5D%7D%5D
Copied!
The kv= will be a URL encoded Json of what you wish to send. In the above case it's this:
1
kv: [{'myKey': ['myValue1', 'myValue2']}]
Copied!

Category Targeting

Category targeting can be sent to the adserver using the c= parameter.
1
&c=category1&c=sport%2Fbasketball&c=politics
Copied!
Woud be the equivalent of sending this in the ad request:
1
c: ['category1', 'sport/basketball', 'politics']
Copied!
the content of the category should be URL encoded.