-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
218 lines (194 loc) · 7.04 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<h1>Vistar Media Client API</h1>
<p>Below is the description of an API which allows clients to schedule real time
ads from <a href="http://www.vistarmedia.com/">Vistar Media</a>'s ad servers. This document
will cover the core types and wire protocols, but implementation documentation
exists elsewhere.</p>
<h2>Overview</h2>
<h2>Message Definitions</h2>
<p>The API provides a number of serialization and deserialization formats. However,
each format will use the same set of model definitions and verbiage.</p>
<h3>AdRequest</h3>
<p>An AdRequest announces to Vistar Media's system that you have free space and
time to show an ad. The specified time need to be "right now," but it should be</p>
<table><thead>
<tr>
<th>Scope</th>
<th>Type</th>
<th>Field</th>
<th></th>
</tr>
</thead><tbody>
<tr>
<td>required</td>
<td>string</td>
<td>network_id</td>
<td></td>
</tr>
<tr>
<td>required</td>
<td>string</td>
<td>api_key</td>
<td></td>
</tr>
<tr>
<td>required</td>
<td>string</td>
<td>device_id</td>
<td></td>
</tr>
<tr>
<td>required</td>
<td>int64</td>
<td>display_time</td>
<td>UTC Epoch Seconds</td>
</tr>
<tr>
<td>repeated</td>
<td>DeviceAttribute</td>
<td>device_attribute</td>
<td></td>
</tr>
<tr>
<td>repeated</td>
<td>DisplayArea</td>
<td>display_area</td>
<td></td>
</tr>
</tbody></table>
<p>For an AdRequest, the <code>network_id</code> and <code>api_key</code> fields must be obtained through
Vistar Media. If you do not have these, contact <a href="mailto:api@vistarmedia.com">api@vistarmedia.com</a>.</p>
<h2>Java API</h2>
<p>There is a complete Java Client API <a href="https://github.com/vistarmedia/client-api">available on Github</a>. This
implementation has been tested in the field, and should be considered reliable.
Its <a href="http://vistarmedia.github.com/client-api/reference/packages.html">Javadocs</a>
provide a number of examples.</p>
<pre><code class="java">import foo.bar.baz
</code></pre>
<h2>Wire Protocols</h2>
<p>All protocols go over HTTP, etc</p>
<h3>Json Protocol</h3>
<pre><code>POST /api/v1/get_ad/json HTTP/1.1
Host: dev.api.vistarmedia.com
{
"network_id": "24ba0582-7648-48b2-a7f4-0af3783b55f0",
"api_key": "eb7d6e26-5930-4fef-a3c7-aa023f31cefd",
"device_id": "device-5122",
"display_time": 1322455356,
"device_attribute": [
{
"name": "zipcode",
"value": "19122"
},
{
"name": "quality",
"value": "pretty good"
}
],
"display_area":[
{
"id": "Display-Area-1",
"width": 800,
"height": 600,
"allow_audio": true,
"supported_media": [
"image/jpeg",
"image/gif"
]
},
{
"id": "Display-Area-2",
"width": 600,
"height": 800,
"allow_audio": true,
"supported_media": [
"image/jpeg",
"image/gif"
]
}
]
}
{
"advertisement":[
{
"lease_id": "618d6b97-a6c6-49d3-aacb-85ff3b2c9136",
"lease_expiry": 1322655356,
"display_area_id": "Display-Area-1",
"asset_id": "ba3f-2ea0",
"asset_url": "http://assets.vistarmedia.com/r/g32/4.gif",
"width": 800,
"height": 600,
"mimeType": "image/gif",
"length_in_seconds": 0
},
{
"lease_id": "97c99267-eee2-4de7-8bfc-5e2146784534",
"lease_expiry": 1234582290,
"display_area_id": "Display-Area-2",
"asset_id": "24f0-83a3",
"asset_url": "http://assets.vistarmedia.com/g/2jc/3fa.jpeg",
"width": 600,
"height": 800,
"mimeType": "image/jpeg",
"length_in_seconds": 0
}
]
}
</code></pre>
<h3>XML Protocol</h3>
<pre><code class="xml">POST /api/v1/get_ad/xml HTTP/1.1
Host: dev.api.vistarmedia.com
<ad_request>
<network_id>24ba0582-7648-48b2-a7f4-0af3783b55f0</network_id>
<api_key>eb7d6e26-5930-4fef-a3c7-aa023f31cefd</api_key>
<device_id>device-5122</device_id>
<display_time>1322455356</display_time>
<device_attribute>
<name>zipcode</name>
<value>19122</value>
</device_attribute>
<device_attribute>
<name>quality</name>
<value>pretty good</value>
</device_attribute>
<display_area>
<id>Display-Area-1</id>
<width>800</width>
<height>600</height>
<allow_audio>true</allow_audio>
<supported_media>image/gif</supported_media>
<supported_media>image/jpeg</supported_media>
</display_area>
<display_area>
<id>Display-Area-2</id>
<width>600</width>
<height>800</height>
<allow_audio>true</allow_audio>
<supported_media>image/gif</supported_media>
<supported_media>image/jpeg</supported_media>
</display_area>
</ad_request>
<AdResponse>
<advertisement>
<lease_id>8a7eb4f7-d63f-488f-bb02-a362c28d70a8</lease_id>
<lease_expiry>1234582290</lease_expiry>
<display_area_id>Display-Area-1</display_area_id>
<asset_id>4</asset_id>
<asset_url>http://assets.vistarmedia.com/r/g32/4.gif</asset_url>
<width>800</width>
<height>600</height>
<mimeType>image/gif</mimeType>
<length_in_seconds>0</length_in_seconds>
</advertisement>
<advertisement>
<lease_id>4915f4f8-4920-4571-b6a5-f8c1bd748e68</lease_id>
<lease_expiry>1234582290</lease_expiry>’
<display_area_id>Display-Area-2</display_area_id>
<asset_id>7</asset_id>
<asset_url>http://assets.vistarmedia.com/g/2jc/3fa.jpeg</asset_url>
<width>600</width>
<height>800</height>
<mimeType>image/jpeg</mimeType>
<length_in_seconds>0</length_in_seconds>
</advertisement>
</AdResponse>
</code></pre>