-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi.html
311 lines (297 loc) · 13 KB
/
api.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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
---
layout: default
title: Api Docs
---
<div class="page-header">
<h1 id="overview">Docs</h1>
</div>
<div class="col-md-3">
<div class="bs-sidebar hidden-print affix" role="complementary">
<ul class="nav bs-sidenav">
<li><a href="#int">Introduction</a></li>
<li><a href="#platform">Domain and platforms</a></li>
<li><a href="#auth">Authentication</a></li>
<li><a href="#list">List</a>
<ul>
<li>list/video</li>
<!-- <li>list/author</li> -->
</ul>
</li>
<li><a href="#match">Metch</a>
<ul>
<li>get/video</li>
<!-- <li>get/author</li> -->
</ul>
</li>
<li><a href="#view">View</a>
<ul>
<!-- <li>Video by Author</li> -->
<li>Video by Date</li>
</ul>
</li>
<li><a href="#search">Search</a></li>
<li><a href="#pagination">Pagination</a></li>
<li><a href="#errors">Errors</a></li>
</ul>
</div>
</div>
<div class="col-md-9">
<p class="lead">
</p>
<h3 id="int" class="sub-title">Introduction</h3>
Digital Bees API (DBAPI from now on) is a restricted REST service developed to serve Digital Bees (DB from now on)
artists and video information to its partners.
The service is based on server side connection between partners server and SRAPI servers and between clients
and DBAPI servers.
<h3 id="platform" class="sub-title">Domains and platforms</h3>
Api Production : <a href="http://api.digitalbees.it" target="_blank">http://api.digitalbees.it</a></br>
<h3 id="auth" class="sub-title">Authenticate</h3>
<p>In order to access this service any partner need to own an authentication pair (“apykey”, “apisecret”), those keys will be manually provided you by DigitalBees.
Those parameters have to be appended on every request as query string:</p>
<div class="well">&apikey=<span class="text-success">< value ></span>&apisecret=<span class="text-success">< value ></span></div>
<h3 id="list" class="sub-title">List</h3>
<p>Response to an index request is an array listing the matching objects.</p>
<table class="table">
<tbody>
<!-- <tr>
<td>List of <b>Author</b></td>
<td>http://api.digitalbees.it/list/author</td>
<td>
<span type="button" class="btn btn-success btn-no-padding">200</span>
<span type="button" class="btn btn-warning btn-no-padding">403</span>
<span type="button" class="btn btn-warning btn-no-padding">404</span>
<span type="button" class="btn btn-danger btn-no-padding">500</span>
<span type="button" class="btn btn-danger btn-no-padding">502</span>
</td>
</tr>
<tr>
<td colspan="3">
/list/author?page=<span class="text-success">1</span>&perPage=<span class="text-success">100</span>&sortProperty=<span class="text-success">creationDate</span>&sortDirection=<span class="text-success">DESC</span>&apikey=<span class="text-success">< value ></span>& apisecret=<span class="text-success">< value ></span>
</td>
</tr> -->
<tr>
<td>List of <b>Video</b></td>
<td>http://api.digitalbees.it/list/author</td>
<td>
<span type="button" class="btn btn-success btn-no-padding">200</span>
<span type="button" class="btn btn-warning btn-no-padding">403</span>
<span type="button" class="btn btn-warning btn-no-padding">404</span>
<span type="button" class="btn btn-danger btn-no-padding">500</span>
<span type="button" class="btn btn-danger btn-no-padding">502</span>
</td>
</tr>
<tr>
<td colspan="3">
/list/video?page=<span class="text-success">1</span>&perPage=<span class="text-success">100</span>&sortProperty=<span class="text-success">creationDate</span>&sortDirection=<span class="text-success">DESC</span>&apikey=<span class="text-success">< value ></span>& apisecret=<span class="text-success">< value ></span>
</td>
</tr>
</tbody>
</table>
This requests is pageable, <a href="#pagination">go to pagionation paragraph</a>
<h3 id="match" class="sub-title">Match</h3>
<table class="table">
<tbody>
<tr>
<td>Match <b>Video by id</b></td>
<td>http://api.digitalbees.it/get/video/<span class="text-success">ID</span></td>
<td>
<span type="button" class="btn btn-success btn-no-padding">200</span>
<span type="button" class="btn btn-warning btn-no-padding">403</span>
<span type="button" class="btn btn-warning btn-no-padding">404</span>
<span type="button" class="btn btn-danger btn-no-padding">500</span>
<span type="button" class="btn btn-danger btn-no-padding">502</span>
</td>
</tr>
<tr>
<td colspan="3">
/get/video/<span class="text-success">1</span>?apikey=<span class="text-success">< value ></span>& apisecret=<span class="text-success">< value ></span>
</td>
</tr>
<!-- <tr>
<td>Match <b>Author by id</b></td>
<td>http://api.digitalbees.it/get/author/<span class="text-success">ID</span></td>
<td>
<span type="button" class="btn btn-success btn-no-padding">200</span>
<span type="button" class="btn btn-warning btn-no-padding">403</span>
<span type="button" class="btn btn-warning btn-no-padding">404</span>
<span type="button" class="btn btn-danger btn-no-padding">500</span>
<span type="button" class="btn btn-danger btn-no-padding">502</span>
</td>
</tr>
<tr>
<td colspan="3">
/get/author/<span class="text-success">1</span>?apikey=<span class="text-success">< value ></span>& apisecret=<span class="text-success">< value ></span>
</td>
</tr> -->
</tbody>
</table>
<h3 id="view" class="sub-title">View</h3>
<table class="table">
<tbody>
<tr>
<td>Match <b>Video from date</b></td>
<td>http://api.digitalbees.it/view/video-from-date?from=<span class="text-success">53463453</span>&to=<span class="text-success">90045432523</span></td>
<td>
<span type="button" class="btn btn-success btn-no-padding">200</span>
<span type="button" class="btn btn-warning btn-no-padding">403</span>
<span type="button" class="btn btn-warning btn-no-padding">404</span>
<span type="button" class="btn btn-danger btn-no-padding">500</span>
<span type="button" class="btn btn-danger btn-no-padding">502</span>
</td>
</tr>
<tr>
<td colspan="3">
/view/video-by-date?from=<span class="text-success">< timecode ></span>&to<span class="text-success">< timecode ></span>&apikey=<span class="text-success">< value ></span>&apisecret=<span class="text-success">< value ></span>
</td>
</tr>
<!-- <tr>
<td>Match <b>Video by Author</b></td>
<td>http://api.digitalbees.it/view/video-by-author?id=<span class="text-success">[int]</span></td>
<td>
<span type="button" class="btn btn-success btn-no-padding">200</span>
<span type="button" class="btn btn-warning btn-no-padding">403</span>
<span type="button" class="btn btn-warning btn-no-padding">404</span>
<span type="button" class="btn btn-danger btn-no-padding">500</span>
<span type="button" class="btn btn-danger btn-no-padding">502</span>
</td>
</tr>
<tr>
<td colspan="3">
/view/video-by-author?id=<span class="text-success">1567</span>&apikey=<span class="text-success">< value ></span>&apisecret=<span class="text-success">< value ></span>
</td>
</tr> -->
<tr>
<td>Match <b>Most Popular Video from Digitalbees</b></td>
<td>http://api.digitalbees.it/view/most-popular-digitalbees</td>
<td>
<span type="button" class="btn btn-success btn-no-padding">200</span>
<span type="button" class="btn btn-warning btn-no-padding">403</span>
<span type="button" class="btn btn-warning btn-no-padding">404</span>
<span type="button" class="btn btn-danger btn-no-padding">500</span>
<span type="button" class="btn btn-danger btn-no-padding">502</span>
</td>
</tr>
<tr>
<td colspan="3">
/view/most-popular-digitalbees?apikey=<span class="text-success">< value ></span>&apisecret=<span class="text-success">< value ></span>
</td>
</tr>
</tbody>
</table>
This requests is pageable, <a href="#pagination">go to pagionation paragraph</a>
<h3 id="search" class="sub-title">Search</h3>
<p>Response to an index request is an array listing the matching objects.</p>
<table class="table">
<tbody>
<tr>
<td>Search <b>Videos</b></td>
<td>http://api.digitalbees.it/search/video</td>
<td>
<span type="button" class="btn btn-success btn-no-padding">200</span>
<span type="button" class="btn btn-warning btn-no-padding">403</span>
<span type="button" class="btn btn-warning btn-no-padding">404</span>
<span type="button" class="btn btn-danger btn-no-padding">500</span>
<span type="button" class="btn btn-danger btn-no-padding">502</span>
</td>
</tr>
<tr>
<td colspan="3">
/search/video?q=<span class="text-success">@name%20call%me%maybe</span>&apikey=<span class="text-success">< value ></span>&apisecret=<span class="text-success">< value ></span>
</td>
</tr>
<!-- <tr>
<td>Search <b>Authors</b></td>
<td>http://api.digitalbees.it/search/author</td>
<td>
<span type="button" class="btn btn-success btn-no-padding">200</span>
<span type="button" class="btn btn-warning btn-no-padding">403</span>
<span type="button" class="btn btn-warning btn-no-padding">404</span>
<span type="button" class="btn btn-danger btn-no-padding">500</span>
<span type="button" class="btn btn-danger btn-no-padding">502</span>
</td>
</tr>
<tr>
<td colspan="3">
/search/author?q=<span class="text-success">@name%20carl%20rae%20jepsen</span>&apikey=<span class="text-success">< value ></span>&apisecret=<span class="text-success">< value ></span>
</td>
</tr> -->
</tbody>
</table>
This requests is pageable, <a href="#pagination">go to pagionation paragraph</a>
<h3 id="pagination" class="sub-title">Pagination</h3>
{% highlight json %}
{
"data":[
...
],
"total":42962,
"page":1,
"pages":430,
"perPage":100,
"sortProperty":"id",
"sortDirection":"DESC"
}
{% endhighlight %}
<table class="table">
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>perPage</td>
<td>integer</td>
<td>perPage is the number of items 100 returned. Default and max value is 100</td>
<td>100</td>
</tr>
<tr>
<td>page</td>
<td>integer</td>
<td>is the page number. The first page is 1.</td>
<td>1</td>
</tr>
<tr>
<td>sortProperty</td>
<td>integer</td>
<td>sortProperty accept a fields as property for sorting.</td>
<td>id</td>
</tr>
<tr>
<td>sortDirection</td>
<td>enum</td>
<td>use sortDirection to obtain ascending (ASC) or descending
(DSC) order.</td>
<td>DESC</td>
</tr>
</tbody>
</table>
<h3 id="errors" class="sub-title">Errors</h3>
<table class="table">
<tbody>
<tr>
<td>400</td>
<td>Bad Request</td>
</tr>
<tr>
<td>403</td>
<td>Forbidden</td>
</tr>
<tr>
<td>404</td>
<td>Not Found</td>
</tr>
<tr>
<td>500</td>
<td>Internal Server Error</td>
</tr>
<tr>
<td>502</td>
<td>Bad Gateway</td>
</tr>
</tbody>
</table>
</div>