-
Notifications
You must be signed in to change notification settings - Fork 0
/
views.py
1328 lines (1322 loc) · 56.2 KB
/
views.py
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
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from rest_framework.permissions import AllowAny
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework_swagger.renderers import SwaggerUIRenderer
class JSONOpenAPIRenderer(JSONRenderer):
format = 'openapi'
class SwaggerSchemaView(APIView):
permission_classes = [AllowAny]
renderer_classes = [
SwaggerUIRenderer,
JSONOpenAPIRenderer
]
def get(self, request):
return Response(get_schema(
host=request.META.get('SERVER_NAME'),
port=request.META.get('SERVER_PORT'),
))
"""
Schema del api de instagram obtenido de http://editor.swagger.io/
"""
def get_schema(host, port):
return {
"swagger": "2.0",
"info": {
"version": "v1",
"title": "Instagram API",
"description": "The first version of the Instagram API is an exciting step forward towards\nmaking it easier for users to have open access to their data. We created it\nso that you can surface the amazing content Instagram users share every\nsecond, in fun and innovative ways.\n\nBuild something great!\n\nOnce you've\n[registered your client](http://instagram.com/developer/register/) it's easy\nto start requesting data from Instagram.\n\nAll endpoints are only accessible via https and are located at\n`api.instagram.com`. For instance: you can grab the most popular photos at\nthe moment by accessing the following URL with your client ID\n(replace CLIENT-ID with your own):\n```\n https://api.instagram.com/v1/media/popular?client_id=CLIENT-ID\n```\nYou're best off using an access_token for the authenticated user for each\nendpoint, though many endpoints don't require it.\nIn some cases an access_token will give you more access to information, and\nin all cases, it means that you are operating under a per-access_token limit\nvs. the same limit for your single client_id.\n\n\n## Limits\nBe nice. If you're sending too many requests too quickly, we'll send back a\n`503` error code (server unavailable).\nYou are limited to 5000 requests per hour per `access_token` or `client_id`\noverall. Practically, this means you should (when possible) authenticate\nusers so that limits are well outside the reach of a given user.\n\n## Deleting Objects\nWe do our best to have all our URLs be\n[RESTful](http://en.wikipedia.org/wiki/Representational_state_transfer).\nEvery endpoint (URL) may support one of four different http verbs. GET\nrequests fetch information about an object, POST requests create objects,\nPUT requests update objects, and finally DELETE requests will delete\nobjects.\n\nSince many old browsers don't support PUT or DELETE, we've made it easy to\nfake PUTs and DELETEs. All you have to do is do a POST with _method=PUT or\n_method=DELETE as a parameter and we will treat it as if you used PUT or\nDELETE respectively.\n\n## Structure\n\n### The Envelope\nEvery response is contained by an envelope. That is, each response has a\npredictable set of keys with which you can expect to interact:\n```json\n{\n \"meta\": {\n \"code\": 200\n },\n \"data\": {\n ...\n },\n \"pagination\": {\n \"next_url\": \"...\",\n \"next_max_id\": \"13872296\"\n }\n}\n```\n\n#### META\nThe meta key is used to communicate extra information about the response to\nthe developer. If all goes well, you'll only ever see a code key with value\n200. However, sometimes things go wrong, and in that case you might see a\nresponse like:\n```json\n{\n \"meta\": {\n \"error_type\": \"OAuthException\",\n \"code\": 400,\n \"error_message\": \"...\"\n }\n}\n```\n\n#### DATA\nThe data key is the meat of the response. It may be a list or dictionary,\nbut either way this is where you'll find the data you requested.\n#### PAGINATION\nSometimes you just can't get enough. For this reason, we've provided a\nconvenient way to access more data in any request for sequential data.\nSimply call the url in the next_url parameter and we'll respond with the\nnext set of data.\n```json\n{\n ...\n \"pagination\": {\n \"next_url\": \"https://api.instagram.com/v1/tags/puppy/media/recent?access_token=fb2e77d.47a0479900504cb3ab4a1f626d174d2d&max_id=13872296\",\n \"next_max_id\": \"13872296\"\n }\n}\n```\nOn views where pagination is present, we also support the \"count\" parameter.\nSimply set this to the number of items you'd like to receive. Note that the\ndefault values should be fine for most applications - but if you decide to\nincrease this number there is a maximum value defined on each endpoint.\n\n### JSONP\nIf you're writing an AJAX application, and you'd like to wrap our response\nwith a callback, all you have to do is specify a callback parameter with\nany API call:\n```\nhttps://api.instagram.com/v1/tags/coffee/media/recent?access_token=fb2e77d.47a0479900504cb3ab4a1f626d174d2d&callback=callbackFunction\n```\nWould respond with:\n```js\ncallbackFunction({\n ...\n});\n```\n",
"termsOfService": "http://instagram.com/about/legal/terms/api"
},
# "host": "api.instagram.com",
"host": "%s:%s" % (host, port),
"basePath": "/v1",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"tags": [
{
"name": "Users"
},
{
"name": "Relationships",
"description": "Relationships are expressed using the following terms:\n\n**outgoing_status**: Your relationship to the user. Can be \"follows\",\n \"requested\", \"none\".\n**incoming_status**: A user's relationship to you. Can be \"followed_by\",\n \"requested_by\", \"blocked_by_you\", \"none\".\n"
},
{
"name": "Media",
"description": "At this time, uploading via the API is not possible. We made a conscious\nchoice not to add this for the following reasons:\n\n* Instagram is about your life on the go – we hope to encourage photos\n from within the app.\n* We want to fight spam & low quality photos. Once we allow uploading\n from other sources, it's harder to control what comes into the Instagram\n ecosystem. All this being said, we're working on ways to ensure users\n have a consistent and high-quality experience on our platform.\n"
},
{
"name": "Commnts"
},
{
"name": "Likes"
},
{
"name": "Tags"
},
{
"name": "Location"
},
{
"name": "Subscribtions"
}
],
"securityDefinitions": {
"oauth": {
"type": "oauth2",
"flow": "implicit",
"authorizationUrl": "https://instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token",
"scopes": {
"basic": "to read any and all data related to a user (e.g. following/followed-by\n lists, photos, etc.) (granted by default)\n",
"comments": "to create or delete comments on a user’s behalf",
"relationships": "to follow and unfollow users on a user’s behalf",
"likes": "to like and unlike items on a user’s behalf"
}
},
"key": {
"type": "apiKey",
"in": "query",
"name": "access_token"
}
},
"security": [
{
"oauth": [
"basic",
"comments",
"relationships",
"likes"
]
},
{
"key": []
}
],
"parameters": {
"user-id": {
"name": "user-id",
"in": "path",
"description": "The user identifier number",
"type": "number",
"required": True
},
"tag-name": {
"name": "tag-name",
"in": "path",
"description": "Tag name",
"type": "string",
"required": True
}
},
"paths": {
"/users/{user-id}": {
"parameters": [
{
"$ref": "#/parameters/user-id"
}
],
"get": {
"security": [
{
"key": []
},
{
"oauth": [
"basic"
]
}
],
"tags": [
"Users"
],
"description": "Get basic information about a user.",
"responses": {
"200": {
"description": "The user object",
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/User"
}
}
}
}
}
}
},
"/users/self/feed": {
"get": {
"tags": [
"Users"
],
"description": "See the authenticated user's feed.",
"parameters": [
{
"name": "count",
"in": "query",
"description": "Count of media to return.",
"type": "integer"
},
{
"name": "max_id",
"in": "query",
"description": "Return media earlier than this max_id.s",
"type": "integer"
},
{
"name": "min_id",
"in": "query",
"description": "Return media later than this min_id.",
"type": "integer"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Media"
}
}
}
}
}
}
}
},
"/users/{user-id}/media/recent": {
"parameters": [
{
"$ref": "#/parameters/user-id"
}
],
"get": {
"tags": [
"Users"
],
"responses": {
"200": {
"description": "Get the most recent media published by a user. To get the most recent\nmedia published by the owner of the access token, you can use `self`\ninstead of the `user-id`.\n",
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Media"
}
}
}
}
}
},
"parameters": [
{
"name": "count",
"in": "query",
"description": "Count of media to return.",
"type": "integer"
},
{
"name": "max_timestamp",
"in": "query",
"description": "Return media before this UNIX timestamp.",
"type": "integer"
},
{
"name": "min_timestamp",
"in": "query",
"description": "Return media after this UNIX timestamp.",
"type": "integer"
},
{
"name": "min_id",
"in": "query",
"description": "Return media later than this min_id.",
"type": "string"
},
{
"name": "max_id",
"in": "query",
"description": "Return media earlier than this max_id.",
"type": "string"
}
]
}
},
"/users/self/media/liked": {
"get": {
"tags": [
"Users"
],
"description": "See the list of media liked by the authenticated user.\nPrivate media is returned as long as the authenticated user\nhas permissionto view that media. Liked media lists are only\navailable for the currently authenticated user.\n",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Media"
}
}
}
}
}
},
"parameters": [
{
"name": "count",
"in": "query",
"description": "Count of media to return.",
"type": "integer"
},
{
"name": "max_like_id",
"in": "query",
"description": "Return media liked before this id.",
"type": "integer"
}
]
}
},
"/users/search": {
"get": {
"tags": [
"Users"
],
"description": "Search for a user by name.",
"parameters": [
{
"name": "q",
"in": "query",
"description": "A query string",
"type": "string",
"required": True
},
{
"name": "count",
"in": "query",
"description": "Number of users to return.",
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/MiniProfile"
}
}
}
}
}
}
}
},
"/users/{user-id}/follows": {
"parameters": [
{
"$ref": "#/parameters/user-id"
}
],
"get": {
"tags": [
"Relationships"
],
"description": "Get the list of users this user follows.",
"responses": {
"200": {
"description": "OK",
"schema": {
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/MiniProfile"
}
}
}
}
}
}
}
},
"/users/{user-id}/followed-by": {
"parameters": [
{
"$ref": "#/parameters/user-id"
}
],
"get": {
"tags": [
"Relationships"
],
"description": "Get the list of users this user is followed by.",
"responses": {
"200": {
"description": "OK",
"schema": {
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/MiniProfile"
}
}
}
}
}
}
}
},
"/users/self/requested-by": {
"get": {
"tags": [
"Relationships"
],
"description": "List the users who have requested this user's permission to follow.\n",
"responses": {
"200": {
"description": "OK",
"schema": {
"properties": {
"meta": {
"properties": {
"code": {
"type": "integer"
}
}
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/MiniProfile"
}
}
}
}
}
}
}
},
"/users/{user-id}/relationship": {
"parameters": [
{
"$ref": "#/parameters/user-id"
}
],
"post": {
"tags": [
"Relationships"
],
"description": "Modify the relationship between the current user and thetarget user.\n",
"security": [
{
"oauth": [
"relationships"
]
}
],
"parameters": [
{
"name": "action",
"in": "body",
"description": "One of follow/unfollow/block/unblock/approve/ignore.",
"schema": {
"type": "string",
"enum": [
"follow",
"unfollow",
"block",
"unblock",
"approve"
]
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/MiniProfile"
}
}
}
}
}
}
}
},
"/media/{media-id}": {
"parameters": [
{
"name": "media-id",
"in": "path",
"description": "The media ID",
"type": "integer",
"required": True
}
],
"get": {
"tags": [
"Media"
],
"description": "Get information about a media object.\nThe returned type key will allow you to differentiate between `image`\nand `video` media.\n\nNote: if you authenticate with an OAuth Token, you will receive the\n`user_has_liked` key which quickly tells you whether the current user\nhas liked this media item.\n",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Media"
}
}
}
}
},
"/media1/{shortcode}": {
"parameters": [
{
"name": "shortcode",
"in": "path",
"description": "The media shortcode",
"type": "string",
"required": True
}
],
"get": {
"tags": [
"Media"
],
"description": "This endpoint returns the same response as **GET** `/media/media-id`.\n\nA media object's shortcode can be found in its shortlink URL.\nAn example shortlink is `http://instagram.com/p/D/`\nIts corresponding shortcode is D.\n",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Media"
}
}
}
}
},
"/media/search": {
"get": {
"tags": [
"Media"
],
"description": "Search for media in a given area. The default time span is set to 5\ndays. The time span must not exceed 7 days. Defaults time stamps cover\nthe last 5 days. Can return mix of image and video types.\n",
"parameters": [
{
"name": "LAT",
"description": "Latitude of the center search coordinate. If used, lng is required.\n",
"type": "number",
"in": "query"
},
{
"name": "MIN_TIMESTAMP",
"description": "A unix timestamp. All media returned will be taken later than\nthis timestamp.\n",
"type": "integer",
"in": "query"
},
{
"name": "LNG",
"description": "Longitude of the center search coordinate. If used, lat is required.\n",
"type": "number",
"in": "query"
},
{
"name": "MAX_TIMESTAMP",
"description": "A unix timestamp. All media returned will be taken earlier than this\ntimestamp.\n",
"type": "integer",
"in": "query"
},
{
"name": "DISTANCE",
"description": "Default is 1km (distance=1000), max distance is 5km.",
"type": "integer",
"maximum": 5000,
"default": 1000,
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"description": "List of all media with added `distance` property",
"properties": {
"data": {
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/definitions/Media"
},
{
"properties": {
"distance": {
"type": "number"
}
}
}
]
}
}
}
}
}
}
}
},
"/media/popular": {
"get": {
"tags": [
"Media"
],
"description": "Get a list of what media is most popular at the moment.\nCan return mix of image and video types.\n",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Media"
}
}
}
}
}
}
}
},
"/media/{media-id}/comments": {
"parameters": [
{
"name": "media-id",
"in": "path",
"description": "Media ID",
"type": "integer",
"required": True
}
],
"get": {
"tags": [
"Comments"
],
"description": "Get a list of recent comments on a media object.\n",
"responses": {
"200": {
"description": "OK",
"schema": {
"properties": {
"meta": {
"properties": {
"code": {
"type": "number"
}
}
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Comment"
}
}
}
}
}
}
},
"post": {
"tags": [
"Comments",
"Media"
],
"description": "Create a comment on a media object with the following rules:\n\n* The total length of the comment cannot exceed 300 characters.\n* The comment cannot contain more than 4 hashtags.\n* The comment cannot contain more than 1 URL.\n* The comment cannot consist of all capital letters.\n",
"security": [
{
"oauth": [
"comments"
]
}
],
"parameters": [
{
"name": "TEXT",
"description": "Text to post as a comment on the media object as specified in\nmedia-id.\n",
"in": "body",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"meta": {
"properties": {
"code": {
"type": "number"
}
}
},
"data": {
"type": "object"
}
}
}
}
}
},
"delete": {
"tags": [
"Comments"
],
"description": "Remove a comment either on the authenticated user's media object or\nauthored by the authenticated user.\n",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"meta": {
"properties": {
"code": {
"type": "number"
}
}
},
"data": {
"type": "object"
}
}
}
}
}
}
},
"/media/{media-id}/likes": {
"parameters": [
{
"name": "media-id",
"in": "path",
"description": "Media ID",
"type": "integer",
"required": True
}
],
"get": {
"tags": [
"Likes",
"Media"
],
"description": "Get a list of users who have liked this media.\n",
"responses": {
"200": {
"description": "OK",
"schema": {
"properties": {
"meta": {
"properties": {
"code": {
"type": "number"
}
}
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Like"
}
}
}
}
}
}
},
"post": {
"tags": [
"Likes"
],
"description": "Set a like on this media by the currently authenticated user.",
"security": [
{
"oauth": [
"comments"
]
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"meta": {
"properties": {
"code": {
"type": "number"
}
}
},
"data": {
"type": "object"
}
}
}
}
}
},
"delete": {
"tags": [
"Likes"
],
"description": "Remove a like on this media by the currently authenticated user.\n",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"meta": {
"properties": {
"code": {
"type": "number"
}
}
},
"data": {
"type": "object"
}
}
}
}
}
}
},
"/tags/{tag-name}": {
"parameters": [
{
"$ref": "#/parameters/tag-name"
}
],
"get": {
"tags": [
"Tags"
],
"description": "Get information about a tag object.",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Tag"
}
}
}
}
},
"/tags/{tag-name}/media/recent": {
"parameters": [
{
"$ref": "#/parameters/tag-name"
}
],
"get": {
"tags": [
"Tags"
],
"description": "Get a list of recently tagged media. Use the `max_tag_id` and\n`min_tag_id` parameters in the pagination response to paginate through\nthese objects.\n",
"responses": {
"200": {
"description": "OK",
"schema": {
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Tag"
}
}
}
}
}
}
}
},
"/tags/search": {
"get": {
"tags": [
"Tags"
],
"parameters": [
{
"name": "q",
"description": "A valid tag name without a leading #. (eg. snowy, nofilter)\n",
"in": "query",
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"meta": {
"properties": {
"code": {
"type": "integer"
}
}
},
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Tag"
}
}
}
}
}
}
}
},
"/locations/{location-id}": {
"parameters": [
{
"name": "location-id",
"description": "Location ID",
"in": "path",
"type": "integer",
"required": True
}
],
"get": {
"tags": [
"Location"
],
"description": "Get information about a location.",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/Location"
}
}
}
}
}
}
},
"/locations/{location-id}/media/recent": {
"parameters": [
{
"name": "location-id",
"description": "Location ID",
"in": "path",
"type": "integer",
"required": True
}
],
"get": {
"tags": [
"Location",
"Media"
],
"description": "Get a list of recent media objects from a given location.",
"parameters": [
{
"name": "max_timestamp",
"in": "query",
"description": "Return media before this UNIX timestamp.",
"type": "integer"
},
{
"name": "min_timestamp",
"in": "query",
"description": "Return media after this UNIX timestamp.",
"type": "integer"
},
{
"name": "min_id",
"in": "query",
"description": "Return media later than this min_id.",
"type": "string"
},
{
"name": "max_id",
"in": "query",
"description": "Return media earlier than this max_id.",
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/Media"