-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiary.apib
542 lines (385 loc) · 14.2 KB
/
apiary.apib
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
FORMAT: 1A
HOST: http://theaustinites.pythonanywhere.com/
# Austin City Limits Project API
ACL Project is a representation of the sponsors, stages, and artists appearing at
**Austin City Limits**.
The API allows **GET** requests to the following:
* Stages
* Sponsors
* Artists
* ArtistMedia
* StageMedia
* SponsorMedia
**Note:** The ACL API now allows information to be selected on a per year basis.
The earliest available year starts at 2012.
# Group Stage
Stage related resources of the Austin City Limits Project API
## Stages [/api/stages/]
The stage's *location* is assigned by a map of the festival.
The Stage resource represents a physical location in the Austin City Limits map.
(see http://theaustinites.pythonanywhere.com/stages/ for the mapping).
Note that depending on the year of the festival, a stage may have a different
sponsor sponsoring that stage or different artists playing on that stage.
+ Model (application/json)
JSON representation of Stage resource.
+ Body
{
[
...,
{ "location": 1,
"years": [2012,2013,2014]
},
...
]
}
### Retrieve all Stages [GET]
A GET request returns all stage locations and the years that stage location was involved in.
+ Response 200 (application/json)
[Stages][]
## Stage [/api/stages/{location}/]
A single stage object.
The Stage resource has the following attributes:
- location
The stage's *location* is assigned by a map of the festival.
The Stage resource represents a physical location in the Austin City Limits map.
(see http://theaustinites.pythonanywhere.com/stages/ for the mapping).
Note that depending on the year of the festival, a stage may have a different
sponsor sponsoring that stage or different artists playing on that stage.
+ Parameters
+ location (integer) ... a number
+ Model (application/json)
JSON representation of Stage resource.
+ Body
{ "location": 1,
"years": [2012,2013,2014]
}
### Retrieve a single Stage [GET]
A GET request returns a json dictionary with string key "years"
and the integer years that the requested stage has been in use for the
festival. The location is also included to be sure the response matches the request.
+ Response 200 (application/json)
[Stage][]
## Stage Collection [/api/stages/{location}/{year}]
A stage collection returns information about it's *sponsor*
and *artists* that play on that stage location for the given year.
+ Parameters
+ location (integer) ... a number
+ year (integer) ... a year starting from 2012
+ Model (application/json)
JSON representation of the Stage Collection Resource.
The Stage resources in the collections are embedded.
+ Body
[
{ "location": 1,
"year": 2014,
"sponsor": sponsor_id,
"artists": [id1,id2,...]
}
]
### List Stage Information for a given year [GET]
A GET request for a **Stage Collection** returns the *location*, *year*, *sponsor id* for
the requested stage location and year, as well as a *list of artist ids*
that have played on that stage during the requested year.
+ Response 200
[Stage Collection][]
# Group Sponsor
Sponsor related resources of the **ACL API**
## Sponsors [/api/sponsors/]
A JSON list of dictionaries returning all Sponsor information
+ Model (application/json)
JSON representation of Sponsors resource.
+ Body
[
...,
{
"id": 42,
"name": "Samsung Galaxy",
"industry": "Mobile",
"years": [2013,...],
"stage_locations":[1,2,3,...]
},
....
]
### Retrieve all Sponsors [GET]
A *GET* request for all artists retrieves business information about that
sponsor as well as a list of years and stage locations each sponsor was involved in at ACL
+ Response 200 (application/json)
[Sponsors][]
## Sponsor [/api/sponsors/{id}/]
A single sponsor object.
The Sponsor resource has the following attributes:
- id
- name
- industry
+ Parameters
+ id (integer) ... ID of the Sponsor in the form of a number
+ Model (application/json)
JSON representation of Sponsor resource.
+ Body
{
"id": 42,
"name": "Tito's Handmade Vodka",
"industry": "alcohol industry"
"years":[2012,2014],
"stage_locations":[3,4,2]
}
### Retrieve a single Sponsor [GET]
A GET request for a sponsor with given id returns
the *id*, *name*, and *industry* the sponsor is associated with.
Note that sponsor names are unique. A list of years and stag locations are also given.
+ Response 200 (application/json)
[Sponsor][]
## Sponsors Year [/api/sponsors/year/{year}]
Collection of all Sponsors that sponsored a Stage for the requested year.
**Note:** that a Sponsor may only sponsor at most one stage for any given year.
+ Model (application/json)
JSON representation of the Sponsor Collection Resource.
The Sponsor resources in the collections are embedded.
+ Body
[
...,
{
"id": 42,
"name": "Artist name",
"industry": "Label of artist",
"stage_location":1
},
...
]
### List All Sponsors for a given year[GET]
A GET request for SponsorYear returns a json dictionary with the year requested and the sponsors participating in that
given year.
+ Response 200
[Sponsors Year][]
# Group Artist
Artist related resources of the **ACL API**
## Artists [/api/artists/]
A JSON list of dictionaries returning all Artist information
+ Model (application/json)
JSON representation of Artist resource.
+ Body
[
...,
{
"id": 42,
"name": "Artist name",
"label": "Label of artist",
"origin": "Where the artist was from",
"genre": "Genre of the artist",
"years": [2013,...],
"stage_locations":[1,2,3,...]
},
....
]
### Retrieve all Artists [GET]
A *GET* request for all artists retrieves music information about that
artist as well as a list of years and stage locations each artist has performed at ACL
+ Response 200 (application/json)
[Artists][]
## Artist [/api/artists/{id}/]
A single Artist object with all its details
The Artist resource has the following attributes:
- id
- name
- label
- origin
- genre
The artist **id** is assigned by the ACL Project API at the moment of creation.
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Artist to perform action with.
+ Model (application/json)
A single JSON representation of Artist resource.
+ Body
[
{
"id": 42,
"name": "Artist name",
"label": "Label of artist",
"origin": "Where the artist was from",
"genre": "Genre of the artist",
"years": [2013,...],
"stage_locations":[1,2,3,...]
}
]
### Retrieve an Artist [GET]
A *GET* request for an artist retrieves music information about that
artist as well as a list of years and stage locations the artist has performed at ACL
+ Response 200 (application/json)
[Artist][]
## Artists Year [/api/artists/year/{year}]
Collection of all Artists for a given year. **Note:** An artist can only play on one
stage for any given year.
It **embeds** *Artist Resources* in the ACL Project API
+ Model (application/json)
JSON representation of the Artist Collection Resource.
The Artist resources in the collections are embedded.
+ Body
[
...,
{
"id": 42,
"name": "Artist name",
"label": "Label of artist",
"origin": "Where the artist was from",
"genre": "Genre of the artist",
"stage_location": 5
},
...
]
### List All Artists by Year [GET]
A GET request returns a json dictionary with an "artists" key whose value
is a list of artist ids and information for ACL in the requested year. The year requested is also included.
+ Response 200
[Artists Year][]
# Group Media
Media related resources for Artist, Stage, and Sponsor
## ArtistMedia [/api/artists/{id}/media/]
A single ArtistMedia object with all its details
The ArtistMedia resource has the following attributes:
- artist
- bio
- photo
- youtube
- video
- twitter
- facebook
- twitterwidget
- youtubevideo
- webpage
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the ArtistMedia to perform action with.
+ Model (application/json)
JSON representation of ArtistMedia resource.
+ Body
{
"artist" : 42,
"bio" : "a description",
"photo" : "url",
"youtube" "url",
"video" : "url",
"twitter" : "url",
"facebook" : "url",
"twitterwidget" : "twitter handle",
"webpage" : "url"
}
### Retrieve an ArtistMedia [GET]
**Note:** Some values of the attribute may not return a value depending on the available information given online.
+ Response 200 (application/json)
[ArtistMedia][]
## SponsorMedia [/api/sponsors/{id}/media/]
A single SponsorMedia object with all its details
The SponsorMedia resource has the following attributes:
- sponsor
- bio
- photo
- youtube
- video
- twitter
- facebook
- twitterwidget
- youtubevideo
- webpage
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the SponsorMedia to perform action with.
+ Model (application/json)
JSON representation of ArtistMedia resource.
+ Body
{
"sponsor" : 42,
"bio" : "a description",
"photo" : "url",
"youtube" "url",
"video" : "url",
"twitter" : "url",
"facebook" : "url",
"twitterwidget" : "twitter handle",
"webpage" : "url"
}
### Retrieve an SponsorMedia [GET]
**Note:** Some values of the attributes may not return a value depending on the available information given online.
+ Response 200 (application/json)
[SponsorMedia][]
## StageMedia [/api/stages/{location}/media/{year}]
A single StageMedia object with all its details for the given year
The StageMedia resource has the following attributes:
- location
- name (usually a stage's name is just the sponsor's name prefixed to "stage")
- year
- bio
- photo
- youtube
- video
- twitter
- facebook
- twitterwidget
- youtubevideo
- webpage
+ Parameters
+ location (required, number, `1`) ... Numeric mapping of`location
` of the StageMedia to perform action with.
+ year (required, number, `2014`) ... requested year
` of the StageMedia to perform action with.
+ Model (application/json)
JSON representation of StageMedia resource.
+ Body
{
"location" : 42,
"name" : "Honda Stage",
"year" : 2013,
"bio" : "a description",
"photo" : "url",
"youtube" "url",
"video" : "url",
"twitter" : "url",
"facebook" : "url",
"twitterwidget" : "twitter handle",
"webpage" : "url",
}
### Retrieve an StageMedia [GET]
**Note:** Some values of the attribute may not return a value depending on the available information given online.
Sponsor media may be used in the event a stage doesn't have the corresponding information.
+ Response 200 (application/json)
[StageMedia][]
## StageMediaList [/api/stages/{location}/media/]
A list of StageMedia objects with all its details for the given stage location
The StageMedia resource has the following attributes:
- location
- name
- year
- bio
- photo
- youtube
- video
- twitter
- facebook
- twitterwidget
- youtubevideo
- webpage
+ Parameters
+ location (required, number, `1`) ... Numeric mapping of`location
` of the StageMedia to perform action with.
+ Model (application/json)
JSON representation of StageMedia resource.
+ Body
[
...,
{
"location" : 42,
"name" : "Honda Stage",
"year" : 2013,
"bio" : "a description",
"photo" : "url",
"youtube" "url",
"video" : "url",
"twitter" : "url",
"facebook" : "url",
"twitterwidget" : "twitter handle",
"webpage" : "url",
},
....
]
### Retrieve a list of StageMedia [GET]
**Note:** Some values of the attribute may not return a value depending on the available information given online.
Sponsor media may be used in the event a stage doesn't have the corresponding information.
+ Response 200 (application/json)
[StageMediaList][]