raml_parser 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +39 -0
  8. data/Rakefile +7 -0
  9. data/lib/raml_parser.rb +270 -0
  10. data/lib/raml_parser/model.rb +146 -0
  11. data/lib/raml_parser/version.rb +3 -0
  12. data/lib/raml_parser/yaml_helper.rb +122 -0
  13. data/raml_parser.gemspec +26 -0
  14. data/spec/examples/raml/documentation.raml +11 -0
  15. data/spec/examples/raml/external/box.raml +8473 -0
  16. data/spec/examples/raml/external/bug.raml +12 -0
  17. data/spec/examples/raml/external/github.raml +21650 -0
  18. data/spec/examples/raml/external/groups_and_nesting.raml +22 -0
  19. data/spec/examples/raml/external/instagram.yml +3369 -0
  20. data/spec/examples/raml/external/json_schema.json +18 -0
  21. data/spec/examples/raml/external/jukebox-api.raml +191 -0
  22. data/spec/examples/raml/external/jukebox-include-album-new.sample +8 -0
  23. data/spec/examples/raml/external/jukebox-include-album-retrieve.sample +30 -0
  24. data/spec/examples/raml/external/jukebox-include-album-songs.sample +14 -0
  25. data/spec/examples/raml/external/jukebox-include-album.schema +36 -0
  26. data/spec/examples/raml/external/jukebox-include-albums.sample +32 -0
  27. data/spec/examples/raml/external/jukebox-include-artist-albums.sample +42 -0
  28. data/spec/examples/raml/external/jukebox-include-artist-new.sample +5 -0
  29. data/spec/examples/raml/external/jukebox-include-artist-retrieve.sample +52 -0
  30. data/spec/examples/raml/external/jukebox-include-artist.schema +20 -0
  31. data/spec/examples/raml/external/jukebox-include-artists.sample +32 -0
  32. data/spec/examples/raml/external/jukebox-include-song-new.sample +5 -0
  33. data/spec/examples/raml/external/jukebox-include-song-retrieve.sample +15 -0
  34. data/spec/examples/raml/external/jukebox-include-song.schema +24 -0
  35. data/spec/examples/raml/external/jukebox-include-songs.sample +14 -0
  36. data/spec/examples/raml/external/linkedin-v1-single.yml +2671 -0
  37. data/spec/examples/raml/external/mule_sales_enablement.raml +148 -0
  38. data/spec/examples/raml/external/multiple-methods.raml +11 -0
  39. data/spec/examples/raml/external/named_parameters.raml +85 -0
  40. data/spec/examples/raml/external/requests-responses.raml +47 -0
  41. data/spec/examples/raml/external/resource_summary_spacing.raml +42 -0
  42. data/spec/examples/raml/external/simple.raml +233 -0
  43. data/spec/examples/raml/external/stripe.raml +12226 -0
  44. data/spec/examples/raml/external/test.raml +11 -0
  45. data/spec/examples/raml/external/twitter.raml +34284 -0
  46. data/spec/examples/raml/external/xml_example.xml +25 -0
  47. data/spec/examples/raml/external/xml_schema.xsd +50 -0
  48. data/spec/examples/raml/formparameters.raml +23 -0
  49. data/spec/examples/raml/headers.raml +15 -0
  50. data/spec/examples/raml/issue2.raml +51 -0
  51. data/spec/examples/raml/methods.raml +9 -0
  52. data/spec/examples/raml/parameters.raml +21 -0
  53. data/spec/examples/raml/parametersinflection.raml +21 -0
  54. data/spec/examples/raml/queryparameters.raml +14 -0
  55. data/spec/examples/raml/requestbodies.raml +21 -0
  56. data/spec/examples/raml/resources.raml +15 -0
  57. data/spec/examples/raml/resourcetypes.raml +16 -0
  58. data/spec/examples/raml/responses.raml +25 -0
  59. data/spec/examples/raml/securedby1.raml +20 -0
  60. data/spec/examples/raml/securedby2.raml +21 -0
  61. data/spec/examples/raml/securityschemes.raml +47 -0
  62. data/spec/examples/raml/simple.raml +6 -0
  63. data/spec/examples/raml/traits.raml +34 -0
  64. data/spec/examples/raml/uriparameters.raml +16 -0
  65. data/spec/examples/yaml/include1.yml +2 -0
  66. data/spec/examples/yaml/include2.yml +1 -0
  67. data/spec/examples/yaml/simple.yml +2 -0
  68. data/spec/examples/yaml/traversing.yml +11 -0
  69. data/spec/lib/raml_parser/yaml_parser_spec.rb +38 -0
  70. data/spec/lib/raml_parser_spec.rb +196 -0
  71. data/spec/spec_helper.rb +91 -0
  72. metadata +229 -0
@@ -0,0 +1,22 @@
1
+ #%RAML 0.8
2
+ title: "Groups and Nesting"
3
+ resourceTypes:
4
+ - someType: {}
5
+ /non-resource-prefix/resource:
6
+ get:
7
+ /nested:
8
+ get:
9
+ /non-resource-prefix/another-resource:
10
+ get:
11
+ /resource-with-nesting:
12
+ type: someType
13
+ get:
14
+ /nested:
15
+ get:
16
+ /another-nested:
17
+ get:
18
+ /resource-without-methods-with-nesting:
19
+ /nested:
20
+ get:
21
+ /another-nested:
22
+ get:
@@ -0,0 +1,3369 @@
1
+ #%RAML 0.8
2
+ ---
3
+ title: Instagram API
4
+ version: v1
5
+ baseUri: https://api.instagram.com/{version}
6
+ securitySchemes:
7
+ - oauth_2_0:
8
+ description: |
9
+ Instagram’s API uses the OAuth 2.0 protocol for simple, but effective
10
+ authentication and authorization. The one thing to keep in mind is that
11
+ all requests to the API must be made over SSL (https:// not http://)
12
+ type: OAuth 2.0
13
+ describedBy:
14
+ queryParameters:
15
+ access_token:
16
+ description: |
17
+ Used to send a valid OAuth 2 access token. Do not use together with
18
+ the "Authorization" header
19
+ type: string
20
+ settings:
21
+ authorizationUri: https://api.instagram.com/oauth/authorize
22
+ accessTokenUri: https://api.instagram.com/oauth/access_token
23
+ authorizationGrants: [ code, token ]
24
+ scopes:
25
+ - basic
26
+ - comments
27
+ - relationships
28
+ - likes
29
+ securedBy: [ oauth_2_0 ]
30
+ mediaType: application/json
31
+ traits:
32
+ - limitableById:
33
+ queryParameters:
34
+ min_id:
35
+ description: Return media later than this min_id.
36
+ type: integer
37
+ max_id:
38
+ description: Return media earlier than this max_id.
39
+ type: integer
40
+ - limitableByTime:
41
+ queryParameters:
42
+ max_timestamp:
43
+ description: Return media before this UNIX timestamp.
44
+ type: integer
45
+ min_timestamp:
46
+ description: Return media after this UNIX timestamp.
47
+ type: integer
48
+ resourceTypes:
49
+ - base:
50
+ get?:
51
+ queryParameters:
52
+ callback:
53
+ description: |
54
+ Callback function name. All output will be wrapper under this function name.
55
+ type: string
56
+ example: callbackFunction
57
+ required: false
58
+ count:
59
+ description: Number of items you would like to receive.
60
+ type: integer
61
+ example: 1
62
+ required: false
63
+ responses:
64
+ 503:
65
+ description: |
66
+ Server Unavailable. Check Your Rate Limits.
67
+ post?:
68
+ responses:
69
+ 503:
70
+ description: |
71
+ Server Unavailable. Check Your Rate Limits.
72
+ delete?:
73
+ responses:
74
+ 503:
75
+ description: |
76
+ Server Unavailable. Check Your Rate Limits.
77
+ documentation:
78
+ - title: Authentication
79
+ content: |
80
+ Instagram’s API uses the [OAuth 2.0 protocol](http://tools.ietf.org/html/draft-ietf-oauth-v2-12) for simple, but effective authentication and authorization. OAuth 2.0 is much easier to use than previous schemes; developers can start using the Instagram API almost immediately. The one thing to keep in mind is that all requests to the API must be made over SSL (https:// not http://)
81
+
82
+ ## Do you need to authenticate?
83
+
84
+ For the most part, Instagram’s API only requires the use of a _client_id). A client_id simply associates your server, script, or program with a specific application. However, some requests require authentication - specifically requests made on behalf of a user. Authenticated requests require an _access_token_. These tokens are unique to a user and should be stored securely. Access tokens may expire at any time in the future.
85
+
86
+ Note that in many situations, you may not need to authenticate users at all. For instance, you may request popular photos without authenticating (i.e. you do not need to provide an access_token; just use your client ID with your request). We only require authentication in cases where your application is making requests on behalf of a user (commenting, liking, browsing a user’s feed, etc.).
87
+
88
+ ## Receiving an access_token
89
+
90
+ In order to receive an access_token, you must do the following:
91
+
92
+ - Direct the user to our authorization url.
93
+ * If the user is not logged in, they will be asked to log in.
94
+ * The user will be asked if they’d like to give your application access to his/her Instagram data.
95
+ - The server will redirect the user in one of two ways that you choose:
96
+ * *Server-side* flow (reccommended):Redirect the user to a URI of your choice. Take the provided
97
+ code parameter and exchange it for an access_token by POSTing the code to our access_token url.
98
+ * *Implicit flow*: Instead of handling a code, we include the access_token as a fragment (#) in the URL. This method allows applications without any server component to receive an access_token with ease.
99
+
100
+ ## Server-side (Explicit) Flow
101
+
102
+ Using the server-side flow is quite easy. Simply follow these steps:
103
+
104
+ ### Step One: Direct your user to our authorization URL
105
+
106
+ ```
107
+ https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code
108
+ ```
109
+
110
+ *Note:* You may provide an optional *scope* parameter to request additional permissions outside of the “basic” permissions scope. [Learn more about scope](http://instagram.com/developer/authentication/#scope).
111
+
112
+ *Note*: You may provide an optional *state* parameter to carry through any server-specific state you need to, for example, protect against CSRF issues.
113
+
114
+ At this point, we present the user with a login screen and then a confirmation screen where they approve your app’s access to his/her Instagram data.
115
+
116
+ ### Step Two: Receive the redirect from Instagram
117
+
118
+ Once a user successfully authenticates and authorizes your application, we will redirect the user to your redirect_uri with a code parameter that you’ll use in step three.
119
+
120
+ ```
121
+ http://your-redirect-uri?code=CODE
122
+ ```
123
+
124
+ Note that your redirect URI's host and path MUST match exactly (including trailing slashes) to your registered redirect_uri. You may also include additional query parameters in the supplied redirect_uri, if you need to vary your behavior dynamically. Examples:
125
+
126
+ |REGISTERED REDIRECT URI |REDIRECT URI SENT TO /AUTHORIZE |VALID?|
127
+ |----------------------------------|-----------------------------------------------|------|
128
+ |http://yourcallback.com/ |http://yourcallback.com/ |yes |
129
+ |http://yourcallback.com/ |http://yourcallback.com/?this=that |yes |
130
+ |http://yourcallback.com/?this=that|http://yourcallback.com/ |no |
131
+ |http://yourcallback.com/?this=that|http://yourcallback.com/?this=that&another=true|yes |
132
+ |http://yourcallback.com/?this=that|http://yourcallback.com/?another=true&this=that|no |
133
+ |http://yourcallback.com/callback |http://yourcallback.com/ |no |
134
+ |http://yourcallback.com/callback |http://yourcallback.com/callback/?type=mobile |yes |
135
+
136
+ If your request for approval is denied by the user, then we will redirect the user to your *redirect_uri* with the following parameters:
137
+
138
+ * *error*: access_denied
139
+
140
+ * *error_reason*: user_denied
141
+
142
+ * *error_description*: The user denied your request
143
+
144
+ ```
145
+ http://your-redirect-uri?error=access_denied&error_reason=user_denied&error_description=The+user+denied+your+request
146
+ ```
147
+
148
+ It is your responsibility to fail gracefully in this situation and display a corresponding error message to your user.
149
+
150
+ ### Step Three: Request the access_token
151
+
152
+ In the previous step, you’ll have received a code which you’ll have to exchange in order to receive an access_token for the user. In order to make this exchange, you simply have to POST this code, along with some app identification parameters to our access_token endpoint. Here are the required parameters:
153
+
154
+ * *client_id*: your client id
155
+ * *client_secret*: your client secret
156
+ * *grant_type*: authorization_code is currently the only supported value
157
+ redirect_uri: the redirect_uri you used in the authorization request. Note: this has to be the same value as in the authorization request.
158
+ * *code*: the exact code you received during the authorization step.
159
+
160
+ For example, you could request an access_token like so:
161
+
162
+ ```
163
+ curl \-F 'client_id=CLIENT-ID' \
164
+ -F 'client_secret=CLIENT-SECRET' \
165
+ -F 'grant_type=authorization_code' \
166
+ -F 'redirect_uri=YOUR-REDIRECT-URI' \
167
+ -F 'code=CODE' \https://api.instagram.com/oauth/access_token
168
+ ```
169
+
170
+ If successful, this call will return a neatly packaged OAuth Token that you can use to make authenticated calls to the API. We also include the user who just authenticated for your convenience:
171
+
172
+ ```json
173
+ {
174
+ "access_token": "fb2e77d.47a0479900504cb3ab4a1f626d174d2d",
175
+ "user": {
176
+ "id": "1574083",
177
+ "username": "snoopdogg",
178
+ "full_name": "Snoop Dogg",
179
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1574083_75sq_1295469061.jpg"
180
+ }
181
+ }
182
+ ```
183
+
184
+ Note that we do not include an expiry time. Our access_tokens have no explicit expiry, though your app should handle the case that either the user revokes access or we expire the token after some period of time. In this case, your response’s meta will contain an “error_type=OAuthAccessTokenError”. In other words: do do not assume your access_token is valid forever.
185
+
186
+ ##Client-Side (Implicit) Authentication
187
+
188
+ If you’re building an app that does not have a server component (a purely javascript app, for instance), you’ll notice that it’s impossible to complete step three above to receive your access_token without also having to ship your client secret. You should never ship your client secret onto devices you don’t control. Then how do you get an access_token? Well the smart folks in charge of the OAuth 2.0 spec anticipated this problem and created the Implicit Authentication Flow.
189
+
190
+ ### Step One: Direct your user to our authorization URL
191
+
192
+ ```
193
+ https://instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token
194
+ ```
195
+
196
+ At this point, we present the user with a login screen and then a confirmation screen where they approve your app’s access to their Instagram data. Note that unlike the explicit flow the response type here is “token”.
197
+
198
+ ### Step Two: Receive the access_token via the URL fragment
199
+
200
+ Once the user has authenticated and then authorized your application, we’ll redirect them to your redirect_uri with the access_token in the url fragment. It’ll look like so:
201
+
202
+ ```
203
+ http://your-redirect-uri#access_token=ACCESS-TOKEN
204
+ ```
205
+
206
+ Simply grab the access_token off the URL fragment and you’re good to go. If the user chooses not to authorize your application, you’ll receive the same error response as in the explicit flow
207
+
208
+ ## Scope (Permissions)
209
+
210
+ The OAuth 2.0 spec allows you to specify the scope of the access you’re requesting from the user. Currently, all apps have basic read access by default. If all you want to do is access data then you do not need to specify a scope (the “basic” scope will be granted automatically).
211
+
212
+ However, if you plan on asking for extended access such as liking, commenting, or managing friendships, you’ll have to specify these scopes in your authorization request. Here are the scopes we currently support:
213
+
214
+ * basic - to read any and all data related to a user (e.g. following/followed-by lists, photos, etc.) (granted by default)
215
+ * comments - to create or delete comments on a user’s behalf
216
+ * relationships - to follow and unfollow users on a user’s behalf
217
+ * likes - to like and unlike items on a user’s behalf
218
+
219
+ You should only request the scope you need at the time of authorization. If in the future you require additional scope, you may forward the user to the authorization URL with that additional scope to be granted. If you attempt to perform a request with an access token that isn’t authorized for that scope, you will receive an OAuthPermissionsException error return.
220
+
221
+ If you’d like to request multiple scopes at once, simply separate the scopes by a space. In the url, this equates to an escaped space (“+”). So if you’re requesting the likes and comments permission, the parameter will look like this:
222
+
223
+ ```
224
+ scope=likes+comments
225
+ ```
226
+
227
+ Note that an empty scope parameter (scope=) is invalid; you must either omit the scope, or specify a non-empty scope list.
228
+ # Media
229
+ /media:
230
+ /{mediaId}:
231
+ uriParameters:
232
+ mediaId:
233
+ type: integer
234
+ type: base
235
+ get:
236
+ # TODO can be different outcomes, so need to define a couple of examples and
237
+ # a couple of schemas instead of given one for 'image'.
238
+ description: |
239
+ Get information about a media object. The returned type key will allow you
240
+ to differentiate between image and video media.
241
+ Note: if you authenticate with an OAuth Token, you will receive the
242
+ user_has_liked key which quickly tells you whether the current user has liked
243
+ this media item.
244
+ responses:
245
+ 200:
246
+ body:
247
+ schema: |
248
+ { "": "http://json-schema.org/draft-03/schema",
249
+ "type": "object",
250
+ "properties": {
251
+ "data": {
252
+ "type": "array",
253
+ "users_in_photo": [
254
+ {
255
+ "properties": {
256
+ "user": {
257
+ "properties": {
258
+ "username": {
259
+ "type": "string"
260
+ },
261
+ "full_name": {
262
+ "type": "string"
263
+ },
264
+ "id": {
265
+ "type": "string"
266
+ },
267
+ "profile_picture": {
268
+ "type": "string"
269
+ }
270
+ },
271
+ "type": "object"
272
+ },
273
+ "position": {
274
+ "properties": {
275
+ "x": {
276
+ "type": "number"
277
+ },
278
+ "y": {
279
+ "type": "number"
280
+ }
281
+ },
282
+ "type": "object"
283
+ }
284
+ },
285
+ "type": "object"
286
+ }
287
+ ],
288
+ "filter": {
289
+ "type": "string"
290
+ },
291
+ "tags": [
292
+ {
293
+ "type": "string"
294
+ }
295
+ ],
296
+ "comments": {
297
+ "properties": {
298
+ "data": [
299
+ {
300
+ "properties": {
301
+ "created_time": {
302
+ "type": "string"
303
+ },
304
+ "text": {
305
+ "type": "string"
306
+ },
307
+ "from": {
308
+ "properties": {
309
+ "username": {
310
+ "type": "string"
311
+ },
312
+ "full_name": {
313
+ "type": "string"
314
+ },
315
+ "id": {
316
+ "type": "string"
317
+ },
318
+ "profile_picture": {
319
+ "type": "string"
320
+ }
321
+ },
322
+ "type": "object"
323
+ },
324
+ "id": {
325
+ "type": "string"
326
+ }
327
+ },
328
+ "type": "object"
329
+ }
330
+ ],
331
+ "type": "array",
332
+ "count": {
333
+ "type": "integer"
334
+ }
335
+ },
336
+ "type": "object"
337
+ },
338
+ "caption": {
339
+ "type": "string"
340
+ },
341
+ "likes": {
342
+ "properties": {
343
+ "count": {
344
+ "type": "integer"
345
+ },
346
+ "data": [
347
+ {
348
+ "properties": {
349
+ "username": {
350
+ "type": "string"
351
+ },
352
+ "full_name": {
353
+ "type": "string"
354
+ },
355
+ "id": {
356
+ "type": "string"
357
+ },
358
+ "profile_picture": {
359
+ "type": "string"
360
+ }
361
+ },
362
+ "type": "object"
363
+ }
364
+ ],
365
+ "type": "array"
366
+ },
367
+ "type": "object"
368
+ },
369
+ "link": {
370
+ "type": "string"
371
+ },
372
+ "user": {
373
+ "properties": {
374
+ "username": {
375
+ "type": "string"
376
+ },
377
+ "full_name": {
378
+ "type": "string"
379
+ },
380
+ "profile_picture": {
381
+ "type": "string"
382
+ },
383
+ "bio": {
384
+ "type": "string"
385
+ },
386
+ "website": {
387
+ "type": "string"
388
+ },
389
+ "id": {
390
+ "type": "string"
391
+ }
392
+ },
393
+ "type": "object"
394
+ },
395
+ "created_time": {
396
+ "type": "string"
397
+ },
398
+ "images": {
399
+ "properties": {
400
+ "low_resolution": {
401
+ "properties": {
402
+ "url": {
403
+ "type": "string"
404
+ },
405
+ "width": {
406
+ "type": "integer"
407
+ },
408
+ "height": {
409
+ "type": "integer"
410
+ }
411
+ },
412
+ "type": "object"
413
+ },
414
+ "thumbnail": {
415
+ "properties": {
416
+ "url": {
417
+ "type": "string"
418
+ },
419
+ "width": {
420
+ "type": "integer"
421
+ },
422
+ "height": {
423
+ "type": "integer"
424
+ }
425
+ },
426
+ "type": "object"
427
+ },
428
+ "standard_resolution": {
429
+ "properties": {
430
+ "url": {
431
+ "type": "string"
432
+ },
433
+ "width": {
434
+ "type": "integer"
435
+ },
436
+ "height": {
437
+ "type": "integer"
438
+ }
439
+ },
440
+ "type": "object"
441
+ }
442
+ },
443
+ "type": "object"
444
+ },
445
+ "id": {
446
+ "type": "string"
447
+ },
448
+ "location": {
449
+ "type": "string"
450
+ }
451
+ }
452
+ }
453
+ }
454
+ example: |
455
+ {
456
+ "data": {
457
+ "type": "image",
458
+ "users_in_photo": [{
459
+ "user": {
460
+ "username": "kevin",
461
+ "full_name": "Kevin S",
462
+ "id": "3",
463
+ "profile_picture": "..."
464
+ },
465
+ "position": {
466
+ "x": 0.315,
467
+ "y": 0.9111
468
+ }
469
+ }],
470
+ "filter": "Walden",
471
+ "tags": [],
472
+ "comments": {
473
+ "data": [{
474
+ "created_time": "1279332030",
475
+ "text": "Love the sign here",
476
+ "from": {
477
+ "username": "mikeyk",
478
+ "full_name": "Mikey Krieger",
479
+ "id": "4",
480
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1242695_75sq_1293915800.jpg"
481
+ },
482
+ "id": "8"
483
+ }],
484
+ "count": 2
485
+ },
486
+ "caption": null,
487
+ "likes": {
488
+ "count": 1,
489
+ "data": [{
490
+ "username": "mikeyk",
491
+ "full_name": "Mikeyk",
492
+ "id": "4",
493
+ "profile_picture": "..."
494
+ }]
495
+ },
496
+ "link": "http://instagr.am/p/D/",
497
+ "user": {
498
+ "username": "kevin",
499
+ "full_name": "Kevin S",
500
+ "profile_picture": "...",
501
+ "bio": "...",
502
+ "website": "...",
503
+ "id": "3"
504
+ },
505
+ "created_time": "1279340983",
506
+ "images": {
507
+ "low_resolution": {
508
+ "url": "http://distillery.s3.amazonaws.com/media/2010/07/16/4de37e03aa4b4372843a7eb33fa41cad_6.jpg",
509
+ "width": 306,
510
+ "height": 306
511
+ },
512
+ "thumbnail": {
513
+ "url": "http://distillery.s3.amazonaws.com/media/2010/07/16/4de37e03aa4b4372843a7eb33fa41cad_5.jpg",
514
+ "width": 150,
515
+ "height": 150
516
+ },
517
+ "standard_resolution": {
518
+ "url": "http://distillery.s3.amazonaws.com/media/2010/07/16/4de37e03aa4b4372843a7eb33fa41cad_7.jpg",
519
+ "width": 612,
520
+ "height": 612
521
+ }
522
+ },
523
+ "id": "3",
524
+ "location": null
525
+ }
526
+ }
527
+ /comments:
528
+ securedBy: [ oauth_2_0: { scopes: [ comments ] } ]
529
+ type: base
530
+ get:
531
+ description: Get a full list of comments on a media.
532
+ responses:
533
+ 200:
534
+ body:
535
+ schema: |
536
+ {
537
+ "": "http://json-schema.org/draft-03/schema",
538
+ "type": "object",
539
+ "properties": {
540
+ "meta": {
541
+ "properties": {
542
+ "code": {
543
+ "type": "integer"
544
+ }
545
+ },
546
+ "type": "object"
547
+ },
548
+ "data": [
549
+ {
550
+ "properties": {
551
+ "created_time": {
552
+ "type": "string"
553
+ },
554
+ "text": {
555
+ "type": "string"
556
+ },
557
+ "from": {
558
+ "properties": {
559
+ "username": {
560
+ "type": "string"
561
+ },
562
+ "profile_picture": {
563
+ "type": "string"
564
+ },
565
+ "id": {
566
+ "type": "string"
567
+ },
568
+ "full_name": {
569
+ "type": "string"
570
+ }
571
+ },
572
+ "type": "object"
573
+ },
574
+ "id": {
575
+ "type": "string"
576
+ }
577
+ },
578
+ "type": "object"
579
+ }
580
+ ],
581
+ "type": "array"
582
+ }
583
+ }
584
+ example: |
585
+ {
586
+ "meta": {
587
+ "code": 200
588
+ },
589
+ "data": [
590
+ {
591
+ "created_time": "1280780324",
592
+ "text": "Really amazing photo!",
593
+ "from": {
594
+ "username": "snoopdogg",
595
+ "profile_picture": "http://images.instagram.com/profiles/profile_16_75sq_1305612434.jpg",
596
+ "id": "1574083",
597
+ "full_name": "Snoop Dogg"
598
+ },
599
+ "id": "420"
600
+ },
601
+ ...
602
+ ]
603
+ }
604
+ post:
605
+ description: Create a comment on a media. Please email apidevelopers[at]instagram.com for access.
606
+ body:
607
+ application/x-www-form-urlencoded:
608
+ formParameters:
609
+ text:
610
+ description: Text to post as a comment on the media as specified in {mediaId}.
611
+ type: string
612
+ required: true
613
+ responses:
614
+ 200:
615
+ body:
616
+ schema: |
617
+ {
618
+ "": "http://json-schema.org/draft-03/schema",
619
+ "type": "object",
620
+ "properties": {
621
+ "meta": {
622
+ "properties": {
623
+ "code": {
624
+ "type": "integer"
625
+ }
626
+ },
627
+ "type": "object"
628
+ },
629
+ "data": [
630
+ {
631
+ "properties": {
632
+ "created_time": {
633
+ "type": "string"
634
+ },
635
+ "text": {
636
+ "type": "string"
637
+ },
638
+ "from": {
639
+ "properties": {
640
+ "username": {
641
+ "type": "string"
642
+ },
643
+ "profile_picture": {
644
+ "type": "string"
645
+ },
646
+ "id": {
647
+ "type": "string"
648
+ },
649
+ "full_name": {
650
+ "type": "string"
651
+ }
652
+ },
653
+ "type": "object"
654
+ },
655
+ "id": {
656
+ "type": "string"
657
+ }
658
+ },
659
+ "type": "object"
660
+ }
661
+ ],
662
+ "type": "array"
663
+ }
664
+ }
665
+ example: |
666
+ {
667
+ "meta": {
668
+ "code": 200
669
+ },
670
+ "data": [
671
+ {
672
+ "created_time": "1280780324",
673
+ "text": "Really amazing photo!",
674
+ "from": {
675
+ "username": "snoopdogg",
676
+ "profile_picture": "http://images.instagram.com/profiles/profile_16_75sq_1305612434.jpg",
677
+ "id": "1574083",
678
+ "full_name": "Snoop Dogg"
679
+ },
680
+ "id": "420"
681
+ },
682
+ ...
683
+ ]
684
+ }
685
+ /{commentId}:
686
+ type: base
687
+ uriParameters:
688
+ commentId:
689
+ type: integer
690
+ description: Idenifier of the comment
691
+ delete:
692
+ description: |
693
+ Remove a comment either on the authenticated user's media or authored by the authenticated user.
694
+ responses:
695
+ 200:
696
+ description: Comment removed.
697
+ /likes:
698
+ securedBy: [ oauth_2_0: { scopes: [ likes ] } ]
699
+ type: base
700
+ get:
701
+ description: |
702
+ Get a list of users who have liked this media.
703
+ Required scope: likes.
704
+ responses:
705
+ 200:
706
+ body:
707
+ schema: |
708
+ {
709
+ "": "http://json-schema.org/draft-03/schema",
710
+ "type": "object",
711
+ "properties": {
712
+ "data": [
713
+ {
714
+ "properties": {
715
+ "username": {
716
+ "type": "string"
717
+ },
718
+ "first_name": {
719
+ "type": "string"
720
+ },
721
+ "last_name": {
722
+ "type": "string"
723
+ },
724
+ "type": {
725
+ "type": "string"
726
+ },
727
+ "id": {
728
+ "type": "string"
729
+ }
730
+ },
731
+ "type": "object"
732
+ }
733
+ ],
734
+ "type": "array"
735
+ }
736
+ }
737
+ example: |
738
+ {
739
+ "data": [{
740
+ "username": "jack",
741
+ "first_name": "Jack",
742
+ "last_name": "Dorsey",
743
+ "type": "user",
744
+ "id": "66"
745
+ },
746
+ {
747
+ "username": "sammyjack",
748
+ "first_name": "Sammy",
749
+ "last_name": "Jack",
750
+ "type": "user",
751
+ "id": "29648"
752
+ }]
753
+ }
754
+ post:
755
+ description: Set a like on this media by the currently authenticated user.
756
+ responses:
757
+ 201:
758
+ description: |
759
+ Successfully liked a media object
760
+ delete:
761
+ description: Remove a like on this media by the currently authenticated user.
762
+ responses:
763
+ 204:
764
+ description: |
765
+ Like removed succesfully
766
+ /search:
767
+ type: base
768
+ get:
769
+ is: [ limitableByTime ]
770
+ description: |
771
+ Search for media in a given area. The default time span is set to 5 days.
772
+ The time span must not exceed 7 days. Defaults time stamps cover the
773
+ last 5 days.
774
+ # TODO oneOf
775
+ queryParameters:
776
+ lat:
777
+ description: Latitude of the center search coordinate. If used, lng is required.
778
+ type: number
779
+ lng:
780
+ description: Longitude of the center search coordinate. If used, lat is required.
781
+ type: number
782
+ distance:
783
+ description: Default is 1km (distance=1000), max distance is 5km.
784
+ responses:
785
+ 200:
786
+ body:
787
+ schema: |
788
+ {
789
+ "": "http://json-schema.org/draft-03/schema",
790
+ "type": "object",
791
+ "properties": {
792
+ "data": [
793
+ {
794
+ "oneOf": [
795
+ {
796
+ "properties": {
797
+ "distance": {
798
+ "type": "number"
799
+ },
800
+ "type": "array",
801
+ "users_in_photo": [
802
+ {
803
+ "type": "string"
804
+ }
805
+ ],
806
+ "filter": {
807
+ "type": "string"
808
+ },
809
+ "tags": [
810
+ {
811
+ "type": "string"
812
+ }
813
+ ],
814
+ "comments": {
815
+ "properties": {
816
+ "data": [
817
+ {
818
+ "properties": {
819
+ "created_time": {
820
+ "type": "string"
821
+ },
822
+ "text": {
823
+ "type": "string"
824
+ },
825
+ "from": {
826
+ "properties": {
827
+ "username": {
828
+ "type": "string"
829
+ },
830
+ "full_name": {
831
+ "type": "string"
832
+ },
833
+ "id": {
834
+ "type": "string"
835
+ },
836
+ "profile_picture": {
837
+ "type": "string"
838
+ }
839
+ },
840
+ "type": "object"
841
+ },
842
+ "id": {
843
+ "type": "string"
844
+ }
845
+ },
846
+ "type": "object"
847
+ }
848
+ ],
849
+ "type": "array",
850
+ "count": {
851
+ "type": "integer"
852
+ }
853
+ },
854
+ "type": "object"
855
+ },
856
+ "caption": {
857
+ "type": "string"
858
+ },
859
+ "likes": {
860
+ "properties": {
861
+ "count": {
862
+ "type": "integer"
863
+ },
864
+ "data": [
865
+ {
866
+ "properties": {
867
+ "username": {
868
+ "type": "string"
869
+ },
870
+ "full_name": {
871
+ "type": "string"
872
+ },
873
+ "id": {
874
+ "type": "string"
875
+ },
876
+ "profile_picture": {
877
+ "type": "string"
878
+ }
879
+ },
880
+ "type": "object"
881
+ }
882
+ ],
883
+ "type": "array"
884
+ },
885
+ "type": "object"
886
+ },
887
+ "link": {
888
+ "type": "string"
889
+ },
890
+ "user": {
891
+ "properties": {
892
+ "username": {
893
+ "type": "string"
894
+ },
895
+ "profile_picture": {
896
+ "type": "string"
897
+ },
898
+ "id": {
899
+ "type": "string"
900
+ }
901
+ },
902
+ "type": "object"
903
+ },
904
+ "created_time": {
905
+ "type": "string"
906
+ },
907
+ "images": {
908
+ "properties": {
909
+ "low_resolution": {
910
+ "properties": {
911
+ "url": {
912
+ "type": "string"
913
+ },
914
+ "width": {
915
+ "type": "integer"
916
+ },
917
+ "height": {
918
+ "type": "integer"
919
+ }
920
+ },
921
+ "type": "object"
922
+ },
923
+ "thumbnail": {
924
+ "properties": {
925
+ "url": {
926
+ "type": "string"
927
+ },
928
+ "width": {
929
+ "type": "integer"
930
+ },
931
+ "height": {
932
+ "type": "integer"
933
+ }
934
+ },
935
+ "type": "object"
936
+ },
937
+ "standard_resolution": {
938
+ "properties": {
939
+ "url": {
940
+ "type": "string"
941
+ },
942
+ "width": {
943
+ "type": "integer"
944
+ },
945
+ "height": {
946
+ "type": "integer"
947
+ }
948
+ },
949
+ "type": "object"
950
+ }
951
+ },
952
+ "type": "object"
953
+ },
954
+ "id": {
955
+ "type": "string"
956
+ },
957
+ "location": {
958
+ "type": "string"
959
+ }
960
+ },
961
+ "type": "object"
962
+ },
963
+ {
964
+ "properties": {
965
+ "distance": {
966
+ "type": "number"
967
+ },
968
+ "type": "object",
969
+ "videos": {
970
+ "low_resolution": {
971
+ "properties": {
972
+ "url": {
973
+ "type": "string"
974
+ },
975
+ "width": {
976
+ "type": "integer"
977
+ },
978
+ "height": {
979
+ "type": "integer"
980
+ }
981
+ },
982
+ "type": "object"
983
+ },
984
+ "standard_resolution": {
985
+ "properties": {
986
+ "url": {
987
+ "type": "string"
988
+ },
989
+ "width": {
990
+ "type": "integer"
991
+ },
992
+ "height": {
993
+ "type": "integer"
994
+ }
995
+ },
996
+ "type": "object"
997
+ },
998
+ "users_in_photo": {
999
+ "type": "string"
1000
+ },
1001
+ "filter": {
1002
+ "type": "string"
1003
+ },
1004
+ "tags": [
1005
+ {
1006
+ "type": "string"
1007
+ }
1008
+ ],
1009
+ "type": "array",
1010
+ "comments": {
1011
+ "data": [
1012
+ {
1013
+ "properties": {
1014
+ "created_time": {
1015
+ "type": "string"
1016
+ },
1017
+ "text": {
1018
+ "type": "string"
1019
+ },
1020
+ "from": {
1021
+ "properties": {
1022
+ "username": {
1023
+ "type": "string"
1024
+ },
1025
+ "full_name": {
1026
+ "type": "string"
1027
+ },
1028
+ "id": {
1029
+ "type": "string"
1030
+ },
1031
+ "profile_picture": {
1032
+ "type": "string"
1033
+ }
1034
+ },
1035
+ "type": "object"
1036
+ },
1037
+ "id": {
1038
+ "type": "string"
1039
+ }
1040
+ },
1041
+ "type": "object"
1042
+ }
1043
+ ],
1044
+ "count": {
1045
+ "type": "integer"
1046
+ }
1047
+ },
1048
+ "caption": {
1049
+ "type": "string"
1050
+ },
1051
+ "likes": {
1052
+ "properties": {
1053
+ "count": {
1054
+ "type": "integer"
1055
+ },
1056
+ "data": [
1057
+ {
1058
+ "properties": {
1059
+ "username": {
1060
+ "type": "string"
1061
+ },
1062
+ "full_name": {
1063
+ "type": "string"
1064
+ },
1065
+ "id": {
1066
+ "type": "string"
1067
+ },
1068
+ "profile_picture": {
1069
+ "type": "string"
1070
+ }
1071
+ },
1072
+ "type": "object"
1073
+ }
1074
+ ],
1075
+ "type": "array"
1076
+ },
1077
+ "type": "object"
1078
+ },
1079
+ "link": {
1080
+ "type": "string"
1081
+ },
1082
+ "user": {
1083
+ "properties": {
1084
+ "username": {
1085
+ "type": "string"
1086
+ },
1087
+ "full_name": {
1088
+ "type": "string"
1089
+ },
1090
+ "profile_picture": {
1091
+ "type": "string"
1092
+ },
1093
+ "bio": {
1094
+ "type": "string"
1095
+ },
1096
+ "website": {
1097
+ "type": "string"
1098
+ },
1099
+ "id": {
1100
+ "type": "string"
1101
+ }
1102
+ },
1103
+ "type": "object"
1104
+ },
1105
+ "created_time": {
1106
+ "type": "string"
1107
+ },
1108
+ "images": {
1109
+ "properties": {
1110
+ "low_resolution": {
1111
+ "properties": {
1112
+ "url": {
1113
+ "type": "string"
1114
+ },
1115
+ "width": {
1116
+ "type": "integer"
1117
+ },
1118
+ "height": {
1119
+ "type": "integer"
1120
+ }
1121
+ },
1122
+ "type": "object"
1123
+ },
1124
+ "thumbnail": {
1125
+ "properties": {
1126
+ "url": {
1127
+ "type": "string"
1128
+ },
1129
+ "width": {
1130
+ "type": "integer"
1131
+ },
1132
+ "height": {
1133
+ "type": "integer"
1134
+ }
1135
+ },
1136
+ "type": "object"
1137
+ },
1138
+ "standard_resolution": {
1139
+ "properties": {
1140
+ "url": {
1141
+ "type": "string"
1142
+ },
1143
+ "width": {
1144
+ "type": "integer"
1145
+ },
1146
+ "height": {
1147
+ "type": "integer"
1148
+ }
1149
+ },
1150
+ "type": "object"
1151
+ }
1152
+ },
1153
+ "type": "object"
1154
+ },
1155
+ "id": {
1156
+ "type": "string"
1157
+ },
1158
+ "location": {
1159
+ "type": "string"
1160
+ }
1161
+ }
1162
+ }
1163
+ }
1164
+ ]
1165
+ }
1166
+ ],
1167
+ "type": "array"
1168
+ }
1169
+ }
1170
+ example: |
1171
+ {
1172
+ "meta": {
1173
+ "code": 200
1174
+ },
1175
+ "data": [{
1176
+ "distance": 41.741369194629698,
1177
+ "type": "image",
1178
+ "users_in_photo": [],
1179
+ "filter": "Earlybird",
1180
+ "tags": [],
1181
+ "comments": { ... },
1182
+ "caption": null,
1183
+ "likes": { ... },
1184
+ "link": "http://instagr.am/p/BQEEq/",
1185
+ "user": {
1186
+ "username": "mahaface",
1187
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1329896_75sq_1294131373.jpg",
1188
+ "id": "1329896"
1189
+ },
1190
+ "created_time": "1296251679",
1191
+ "images": {
1192
+ "low_resolution": {
1193
+ "url": "http://distillery.s3.amazonaws.com/media/2011/01/28/0cc4f24f25654b1c8d655835c58b850a_6.jpg",
1194
+ "width": 306,
1195
+ "height": 306
1196
+ },
1197
+ "thumbnail": {
1198
+ "url": "http://distillery.s3.amazonaws.com/media/2011/01/28/0cc4f24f25654b1c8d655835c58b850a_5.jpg",
1199
+ "width": 150,
1200
+ "height": 150
1201
+ },
1202
+ "standard_resolution": {
1203
+ "url": "http://distillery.s3.amazonaws.com/media/2011/01/28/0cc4f24f25654b1c8d655835c58b850a_7.jpg",
1204
+ "width": 612,
1205
+ "height": 612
1206
+ }
1207
+ },
1208
+ "id": "20988202",
1209
+ "location": null
1210
+ },
1211
+ ...
1212
+ ]
1213
+ }
1214
+ /popular:
1215
+ type: base
1216
+ get:
1217
+ description: |
1218
+ Get a list of what media is most popular at the moment.
1219
+ responses:
1220
+ 200:
1221
+ body:
1222
+ schema: |
1223
+ {
1224
+ "": "http://json-schema.org/draft-03/schema",
1225
+ "type": "object",
1226
+ "properties": {
1227
+ "data": [
1228
+ {
1229
+ "oneOf": [
1230
+ {
1231
+ "properties": {
1232
+ "distance": {
1233
+ "type": "number"
1234
+ },
1235
+ "type": "array",
1236
+ "users_in_photo": [
1237
+ {
1238
+ "type": "string"
1239
+ }
1240
+ ],
1241
+ "filter": {
1242
+ "type": "string"
1243
+ },
1244
+ "tags": [
1245
+ {
1246
+ "type": "string"
1247
+ }
1248
+ ],
1249
+ "comments": {
1250
+ "properties": {
1251
+ "data": [
1252
+ {
1253
+ "properties": {
1254
+ "created_time": {
1255
+ "type": "string"
1256
+ },
1257
+ "text": {
1258
+ "type": "string"
1259
+ },
1260
+ "from": {
1261
+ "properties": {
1262
+ "username": {
1263
+ "type": "string"
1264
+ },
1265
+ "full_name": {
1266
+ "type": "string"
1267
+ },
1268
+ "id": {
1269
+ "type": "string"
1270
+ },
1271
+ "profile_picture": {
1272
+ "type": "string"
1273
+ }
1274
+ },
1275
+ "type": "object"
1276
+ },
1277
+ "id": {
1278
+ "type": "string"
1279
+ }
1280
+ },
1281
+ "type": "object"
1282
+ }
1283
+ ],
1284
+ "type": "array",
1285
+ "count": {
1286
+ "type": "integer"
1287
+ }
1288
+ },
1289
+ "type": "object"
1290
+ },
1291
+ "caption": {
1292
+ "type": "string"
1293
+ },
1294
+ "likes": {
1295
+ "properties": {
1296
+ "count": {
1297
+ "type": "integer"
1298
+ },
1299
+ "data": [
1300
+ {
1301
+ "properties": {
1302
+ "username": {
1303
+ "type": "string"
1304
+ },
1305
+ "full_name": {
1306
+ "type": "string"
1307
+ },
1308
+ "id": {
1309
+ "type": "string"
1310
+ },
1311
+ "profile_picture": {
1312
+ "type": "string"
1313
+ }
1314
+ },
1315
+ "type": "object"
1316
+ }
1317
+ ],
1318
+ "type": "array"
1319
+ },
1320
+ "type": "object"
1321
+ },
1322
+ "link": {
1323
+ "type": "string"
1324
+ },
1325
+ "user": {
1326
+ "properties": {
1327
+ "username": {
1328
+ "type": "string"
1329
+ },
1330
+ "profile_picture": {
1331
+ "type": "string"
1332
+ },
1333
+ "id": {
1334
+ "type": "string"
1335
+ }
1336
+ },
1337
+ "type": "object"
1338
+ },
1339
+ "created_time": {
1340
+ "type": "string"
1341
+ },
1342
+ "images": {
1343
+ "properties": {
1344
+ "low_resolution": {
1345
+ "properties": {
1346
+ "url": {
1347
+ "type": "string"
1348
+ },
1349
+ "width": {
1350
+ "type": "integer"
1351
+ },
1352
+ "height": {
1353
+ "type": "integer"
1354
+ }
1355
+ },
1356
+ "type": "object"
1357
+ },
1358
+ "thumbnail": {
1359
+ "properties": {
1360
+ "url": {
1361
+ "type": "string"
1362
+ },
1363
+ "width": {
1364
+ "type": "integer"
1365
+ },
1366
+ "height": {
1367
+ "type": "integer"
1368
+ }
1369
+ },
1370
+ "type": "object"
1371
+ },
1372
+ "standard_resolution": {
1373
+ "properties": {
1374
+ "url": {
1375
+ "type": "string"
1376
+ },
1377
+ "width": {
1378
+ "type": "integer"
1379
+ },
1380
+ "height": {
1381
+ "type": "integer"
1382
+ }
1383
+ },
1384
+ "type": "object"
1385
+ }
1386
+ },
1387
+ "type": "object"
1388
+ },
1389
+ "id": {
1390
+ "type": "string"
1391
+ },
1392
+ "location": {
1393
+ "type": "string"
1394
+ }
1395
+ },
1396
+ "type": "object"
1397
+ },
1398
+ {
1399
+ "properties": {
1400
+ "distance": {
1401
+ "type": "number"
1402
+ },
1403
+ "type": "object",
1404
+ "videos": {
1405
+ "low_resolution": {
1406
+ "properties": {
1407
+ "url": {
1408
+ "type": "string"
1409
+ },
1410
+ "width": {
1411
+ "type": "integer"
1412
+ },
1413
+ "height": {
1414
+ "type": "integer"
1415
+ }
1416
+ },
1417
+ "type": "object"
1418
+ },
1419
+ "standard_resolution": {
1420
+ "properties": {
1421
+ "url": {
1422
+ "type": "string"
1423
+ },
1424
+ "width": {
1425
+ "type": "integer"
1426
+ },
1427
+ "height": {
1428
+ "type": "integer"
1429
+ }
1430
+ },
1431
+ "type": "object"
1432
+ },
1433
+ "users_in_photo": {
1434
+ "type": "string"
1435
+ },
1436
+ "filter": {
1437
+ "type": "string"
1438
+ },
1439
+ "tags": [
1440
+ {
1441
+ "type": "string"
1442
+ }
1443
+ ],
1444
+ "type": "array",
1445
+ "comments": {
1446
+ "data": [
1447
+ {
1448
+ "properties": {
1449
+ "created_time": {
1450
+ "type": "string"
1451
+ },
1452
+ "text": {
1453
+ "type": "string"
1454
+ },
1455
+ "from": {
1456
+ "properties": {
1457
+ "username": {
1458
+ "type": "string"
1459
+ },
1460
+ "full_name": {
1461
+ "type": "string"
1462
+ },
1463
+ "id": {
1464
+ "type": "string"
1465
+ },
1466
+ "profile_picture": {
1467
+ "type": "string"
1468
+ }
1469
+ },
1470
+ "type": "object"
1471
+ },
1472
+ "id": {
1473
+ "type": "string"
1474
+ }
1475
+ },
1476
+ "type": "object"
1477
+ }
1478
+ ],
1479
+ "count": {
1480
+ "type": "integer"
1481
+ }
1482
+ },
1483
+ "caption": {
1484
+ "type": "string"
1485
+ },
1486
+ "likes": {
1487
+ "properties": {
1488
+ "count": {
1489
+ "type": "integer"
1490
+ },
1491
+ "data": [
1492
+ {
1493
+ "properties": {
1494
+ "username": {
1495
+ "type": "string"
1496
+ },
1497
+ "full_name": {
1498
+ "type": "string"
1499
+ },
1500
+ "id": {
1501
+ "type": "string"
1502
+ },
1503
+ "profile_picture": {
1504
+ "type": "string"
1505
+ }
1506
+ },
1507
+ "type": "object"
1508
+ }
1509
+ ],
1510
+ "type": "array"
1511
+ },
1512
+ "type": "object"
1513
+ },
1514
+ "link": {
1515
+ "type": "string"
1516
+ },
1517
+ "user": {
1518
+ "properties": {
1519
+ "username": {
1520
+ "type": "string"
1521
+ },
1522
+ "full_name": {
1523
+ "type": "string"
1524
+ },
1525
+ "profile_picture": {
1526
+ "type": "string"
1527
+ },
1528
+ "bio": {
1529
+ "type": "string"
1530
+ },
1531
+ "website": {
1532
+ "type": "string"
1533
+ },
1534
+ "id": {
1535
+ "type": "string"
1536
+ }
1537
+ },
1538
+ "type": "object"
1539
+ },
1540
+ "created_time": {
1541
+ "type": "string"
1542
+ },
1543
+ "images": {
1544
+ "properties": {
1545
+ "low_resolution": {
1546
+ "properties": {
1547
+ "url": {
1548
+ "type": "string"
1549
+ },
1550
+ "width": {
1551
+ "type": "integer"
1552
+ },
1553
+ "height": {
1554
+ "type": "integer"
1555
+ }
1556
+ },
1557
+ "type": "object"
1558
+ },
1559
+ "thumbnail": {
1560
+ "properties": {
1561
+ "url": {
1562
+ "type": "string"
1563
+ },
1564
+ "width": {
1565
+ "type": "integer"
1566
+ },
1567
+ "height": {
1568
+ "type": "integer"
1569
+ }
1570
+ },
1571
+ "type": "object"
1572
+ },
1573
+ "standard_resolution": {
1574
+ "properties": {
1575
+ "url": {
1576
+ "type": "string"
1577
+ },
1578
+ "width": {
1579
+ "type": "integer"
1580
+ },
1581
+ "height": {
1582
+ "type": "integer"
1583
+ }
1584
+ },
1585
+ "type": "object"
1586
+ }
1587
+ },
1588
+ "type": "object"
1589
+ },
1590
+ "id": {
1591
+ "type": "string"
1592
+ },
1593
+ "location": {
1594
+ "type": "string"
1595
+ }
1596
+ }
1597
+ }
1598
+ }
1599
+ ]
1600
+ }
1601
+ ],
1602
+ "type": "array"
1603
+ }
1604
+ }
1605
+ example: |
1606
+ {
1607
+ "meta": {
1608
+ "code": 200
1609
+ },
1610
+ "data": [{
1611
+ "distance": 41.741369194629698,
1612
+ "type": "image",
1613
+ "users_in_photo": [],
1614
+ "filter": "Earlybird",
1615
+ "tags": [],
1616
+ "comments": { ... },
1617
+ "caption": null,
1618
+ "likes": { ... },
1619
+ "link": "http://instagr.am/p/BQEEq/",
1620
+ "user": {
1621
+ "username": "mahaface",
1622
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1329896_75sq_1294131373.jpg",
1623
+ "id": "1329896"
1624
+ },
1625
+ "created_time": "1296251679",
1626
+ "images": {
1627
+ "low_resolution": {
1628
+ "url": "http://distillery.s3.amazonaws.com/media/2011/01/28/0cc4f24f25654b1c8d655835c58b850a_6.jpg",
1629
+ "width": 306,
1630
+ "height": 306
1631
+ },
1632
+ "thumbnail": {
1633
+ "url": "http://distillery.s3.amazonaws.com/media/2011/01/28/0cc4f24f25654b1c8d655835c58b850a_5.jpg",
1634
+ "width": 150,
1635
+ "height": 150
1636
+ },
1637
+ "standard_resolution": {
1638
+ "url": "http://distillery.s3.amazonaws.com/media/2011/01/28/0cc4f24f25654b1c8d655835c58b850a_7.jpg",
1639
+ "width": 612,
1640
+ "height": 612
1641
+ }
1642
+ },
1643
+ "id": "20988202",
1644
+ "location": null
1645
+ },
1646
+ ...
1647
+ ]
1648
+ }
1649
+ # Tags
1650
+ /tags:
1651
+ /{tagName}:
1652
+ uriParameters:
1653
+ tagName:
1654
+ description: Name of tag.
1655
+ type: string
1656
+ type: base
1657
+ get:
1658
+ description: Get information about a tag object.
1659
+ responses:
1660
+ 200:
1661
+ body:
1662
+ schema: |
1663
+ {
1664
+ "": "http://json-schema.org/draft-03/schema",
1665
+ "type": "object",
1666
+ "properties": {
1667
+ "data": {
1668
+ "properties": {
1669
+ "media_count": {
1670
+ "type": "integer"
1671
+ },
1672
+ "name": {
1673
+ "type": "string"
1674
+ }
1675
+ },
1676
+ "type": "object"
1677
+ }
1678
+ }
1679
+ }
1680
+ example: |
1681
+ {
1682
+ "data": {
1683
+ "media_count": 472,
1684
+ "name": "nofilter",
1685
+ }
1686
+ }
1687
+ /media/recent:
1688
+ type: base
1689
+ get:
1690
+ is: [ limitableById ]
1691
+ description: |
1692
+ Get a list of recently tagged media. Note that this media is ordered by when the media was tagged
1693
+ with this tag, rather than the order it was posted. Use the max_tag_id and min_tag_id parameters
1694
+ in the pagination response to paginate through these objects.
1695
+ responses:
1696
+ 200:
1697
+ body:
1698
+ schema: |
1699
+ {
1700
+ "": "http://json-schema.org/draft-03/schema",
1701
+ "type": "object",
1702
+ "properties": {
1703
+ "data": [
1704
+ {
1705
+ "properties": {
1706
+ "data": [
1707
+ {
1708
+ "type": "array",
1709
+ "users_in_photo": [
1710
+ {
1711
+ "type": "string"
1712
+ }
1713
+ ],
1714
+ "filter": {
1715
+ "type": "string"
1716
+ },
1717
+ "tags": [
1718
+ {
1719
+ "type": "string"
1720
+ }
1721
+ ],
1722
+ "comments": {
1723
+ "properties": {
1724
+ "data": [
1725
+ {
1726
+ "properties": {
1727
+ "created_time": {
1728
+ "type": "string"
1729
+ },
1730
+ "text": {
1731
+ "type": "string"
1732
+ },
1733
+ "from": {
1734
+ "properties": {
1735
+ "username": {
1736
+ "type": "string"
1737
+ },
1738
+ "id": {
1739
+ "type": "string"
1740
+ }
1741
+ },
1742
+ "type": "object"
1743
+ },
1744
+ "id": {
1745
+ "type": "string"
1746
+ }
1747
+ },
1748
+ "type": "object"
1749
+ }
1750
+ ],
1751
+ "type": "array",
1752
+ "count": {
1753
+ "type": "integer"
1754
+ }
1755
+ },
1756
+ "type": "object"
1757
+ },
1758
+ "caption": {
1759
+ "properties": {
1760
+ "created_time": {
1761
+ "type": "string"
1762
+ },
1763
+ "text": {
1764
+ "type": "string"
1765
+ },
1766
+ "from": {
1767
+ "properties": {
1768
+ "username": {
1769
+ "type": "string"
1770
+ },
1771
+ "id": {
1772
+ "type": "string"
1773
+ }
1774
+ },
1775
+ "type": "object"
1776
+ },
1777
+ "id": {
1778
+ "type": "string"
1779
+ }
1780
+ },
1781
+ "type": "object"
1782
+ },
1783
+ "likes": {
1784
+ "count": {
1785
+ "type": "integer"
1786
+ },
1787
+ "data": [
1788
+ {
1789
+ "properties": {
1790
+ "username": {
1791
+ "type": "string"
1792
+ },
1793
+ "full_name": {
1794
+ "type": "string"
1795
+ },
1796
+ "id": {
1797
+ "type": "string"
1798
+ },
1799
+ "profile_picture": {
1800
+ "type": "string"
1801
+ }
1802
+ },
1803
+ "type": "object"
1804
+ }
1805
+ ],
1806
+ "type": "array"
1807
+ },
1808
+ "link": {
1809
+ "type": "string"
1810
+ },
1811
+ "user": {
1812
+ "properties": {
1813
+ "username": {
1814
+ "type": "string"
1815
+ },
1816
+ "profile_picture": {
1817
+ "type": "string"
1818
+ },
1819
+ "id": {
1820
+ "type": "string"
1821
+ },
1822
+ "full_name": {
1823
+ "type": "string"
1824
+ }
1825
+ },
1826
+ "type": "object"
1827
+ },
1828
+ "created_time": {
1829
+ "type": "string"
1830
+ },
1831
+ "images": {
1832
+ "properties": {
1833
+ "low_resolution": {
1834
+ "properties": {
1835
+ "url": {
1836
+ "type": "string"
1837
+ },
1838
+ "width": {
1839
+ "type": "integer"
1840
+ },
1841
+ "height": {
1842
+ "type": "integer"
1843
+ }
1844
+ },
1845
+ "type": "object"
1846
+ },
1847
+ "thumbnail": {
1848
+ "properties": {
1849
+ "url": {
1850
+ "type": "string"
1851
+ },
1852
+ "width": {
1853
+ "type": "integer"
1854
+ },
1855
+ "height": {
1856
+ "type": "integer"
1857
+ }
1858
+ },
1859
+ "type": "object"
1860
+ },
1861
+ "standard_resolution": {
1862
+ "properties": {
1863
+ "url": {
1864
+ "type": "string"
1865
+ },
1866
+ "width": {
1867
+ "type": "integer"
1868
+ },
1869
+ "height": {
1870
+ "type": "integer"
1871
+ }
1872
+ },
1873
+ "type": "object"
1874
+ }
1875
+ },
1876
+ "type": "object"
1877
+ },
1878
+ "id": {
1879
+ "type": "string"
1880
+ },
1881
+ "location": {
1882
+ "type": "string"
1883
+ }
1884
+ }
1885
+ ],
1886
+ "type": "array"
1887
+ },
1888
+ "type": "object"
1889
+ }
1890
+ ],
1891
+ "type": "array"
1892
+ }
1893
+ }
1894
+ example: |
1895
+ {
1896
+ "data": [{
1897
+ "type": "image",
1898
+ "users_in_photo": [],
1899
+ "filter": "Earlybird",
1900
+ "tags": ["snow"],
1901
+ "comments": {
1902
+ "data": [{
1903
+ "created_time": "1296703540",
1904
+ "text": "Snow",
1905
+ "from": {
1906
+ "username": "emohatch",
1907
+ "username": "Dave",
1908
+ "id": "1242695"
1909
+ },
1910
+ "id": "26589964"
1911
+ },
1912
+ {
1913
+ "created_time": "1296707889",
1914
+ "text": "#snow",
1915
+ "from": {
1916
+ "username": "emohatch",
1917
+ "username": "Emo Hatch",
1918
+ "id": "1242695"
1919
+ },
1920
+ "id": "26609649"
1921
+ }],
1922
+ "count": 3
1923
+ },
1924
+ "caption": {
1925
+ "created_time": "1296703540",
1926
+ "text": "#Snow",
1927
+ "from": {
1928
+ "username": "emohatch",
1929
+ "id": "1242695"
1930
+ },
1931
+ "id": "26589964"
1932
+ },
1933
+ "likes": {
1934
+ "count": 1,
1935
+ "data": [{
1936
+ "username": "mikeyk",
1937
+ "full_name": "Mike Krieger",
1938
+ "id": "4",
1939
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1242695_75sq_1293915800.jpg"
1940
+ }]
1941
+ },
1942
+ "link": "http://instagr.am/p/BWl6P/",
1943
+ "user": {
1944
+ "username": "emohatch",
1945
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1242695_75sq_1293915800.jpg",
1946
+ "id": "1242695",
1947
+ "full_name": "Dave"
1948
+ },
1949
+ "created_time": "1296703536",
1950
+ "images": {
1951
+ "low_resolution": {
1952
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/02/f9443f3443484c40b4792fa7c76214d5_6.jpg",
1953
+ "width": 306,
1954
+ "height": 306
1955
+ },
1956
+ "thumbnail": {
1957
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/02/f9443f3443484c40b4792fa7c76214d5_5.jpg",
1958
+ "width": 150,
1959
+ "height": 150
1960
+ },
1961
+ "standard_resolution": {
1962
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/02/f9443f3443484c40b4792fa7c76214d5_7.jpg",
1963
+ "width": 612,
1964
+ "height": 612
1965
+ }
1966
+ },
1967
+ "id": "22699663",
1968
+ "location": null
1969
+ }
1970
+ ]
1971
+ }
1972
+ /search:
1973
+ type: base
1974
+ get:
1975
+ description: |
1976
+ Search for tags by name. Results are ordered first as an exact match, then by popularity.
1977
+ Short tags will be treated as exact matches.
1978
+ queryParameters:
1979
+ q:
1980
+ description: |
1981
+ A valid tag name without a leading #.
1982
+ type: string
1983
+ required: true
1984
+ example: nofilter
1985
+ responses:
1986
+ 200:
1987
+ body:
1988
+ schema: |
1989
+ {
1990
+ "": "http://json-schema.org/draft-03/schema",
1991
+ "type": "object",
1992
+ "properties": {
1993
+ "data": [
1994
+ {
1995
+ "properties": {
1996
+ "media_count": {
1997
+ "type": "integer"
1998
+ },
1999
+ "name": {
2000
+ "type": "string"
2001
+ }
2002
+ },
2003
+ "type": "object"
2004
+ }
2005
+ ],
2006
+ "type": "array"
2007
+ }
2008
+ }
2009
+ example: |
2010
+ {
2011
+ "data": [
2012
+ {
2013
+ "media_count": 43590,
2014
+ "name": "snowy"
2015
+ },
2016
+ {
2017
+ "media_count": 3264,
2018
+ "name": "snowyday"
2019
+ },
2020
+ {
2021
+ "media_count": 1880,
2022
+ "name": "snowymountains"
2023
+ },
2024
+ {
2025
+ "media_count": 1164,
2026
+ "name": "snowydays"
2027
+ },
2028
+ {
2029
+ "media_count": 776,
2030
+ "name": "snowyowl"
2031
+ },
2032
+ {
2033
+ "media_count": 680,
2034
+ "name": "snowynight"
2035
+ },
2036
+ {
2037
+ "media_count": 568,
2038
+ "name": "snowylebanon"
2039
+ },
2040
+ {
2041
+ "media_count": 522,
2042
+ "name": "snowymountain"
2043
+ },
2044
+ {
2045
+ "media_count": 490,
2046
+ "name": "snowytrees"
2047
+ },
2048
+ {
2049
+ "media_count": 260,
2050
+ "name": "snowynights"
2051
+ },
2052
+ {
2053
+ "media_count": 253,
2054
+ "name": "snowyegret"
2055
+ },
2056
+ {
2057
+ "media_count": 223,
2058
+ "name": "snowytree"
2059
+ },
2060
+ {
2061
+ "media_count": 214,
2062
+ "name": "snowymorning"
2063
+ },
2064
+ {
2065
+ "media_count": 212,
2066
+ "name": "snowyweather"
2067
+ },
2068
+ {
2069
+ "media_count": 161,
2070
+ "name": "snowyoursupport"
2071
+ },
2072
+ {
2073
+ "media_count": 148,
2074
+ "name": "snowyrange"
2075
+ },
2076
+ {
2077
+ "media_count": 136,
2078
+ "name": "snowynui3z"
2079
+ },
2080
+ {
2081
+ "media_count": 128,
2082
+ "name": "snowypeaks"
2083
+ },
2084
+ {
2085
+ "media_count": 124,
2086
+ "name": "snowy_dog"
2087
+ },
2088
+ {
2089
+ "media_count": 120,
2090
+ "name": "snowyroad"
2091
+ },
2092
+ {
2093
+ "media_count": 108,
2094
+ "name": "snowyoghurt"
2095
+ },
2096
+ {
2097
+ "media_count": 107,
2098
+ "name": "snowyriver"
2099
+ }
2100
+ ],
2101
+ "meta": {
2102
+ "code": 200
2103
+ }
2104
+ }
2105
+ # Users
2106
+ /users:
2107
+ /{userId}:
2108
+ uriParameters:
2109
+ userId:
2110
+ type: integer
2111
+ type: base
2112
+ get:
2113
+ description: Get basic information about a user.
2114
+ responses:
2115
+ 200:
2116
+ body:
2117
+ schema: |
2118
+ {
2119
+ "": "http://json-schema.org/draft-03/schema",
2120
+ "type": "object",
2121
+ "properties": {
2122
+ "data": {
2123
+ "properties": {
2124
+ "id": {
2125
+ "type": "string"
2126
+ },
2127
+ "username": {
2128
+ "type": "string"
2129
+ },
2130
+ "full_name": {
2131
+ "type": "string"
2132
+ },
2133
+ "profile_picture": {
2134
+ "type": "string"
2135
+ },
2136
+ "bio": {
2137
+ "type": "string"
2138
+ },
2139
+ "website": {
2140
+ "type": "string"
2141
+ },
2142
+ "counts": {
2143
+ "properties": {
2144
+ "media": {
2145
+ "type": "integer"
2146
+ },
2147
+ "follows": {
2148
+ "type": "integer"
2149
+ },
2150
+ "followed_by": {
2151
+ "type": "integer"
2152
+ }
2153
+ },
2154
+ "type": "object"
2155
+ }
2156
+ },
2157
+ "type": "object"
2158
+ }
2159
+ }
2160
+ }
2161
+ example: |
2162
+ {
2163
+ "data": {
2164
+ "id": "1574083",
2165
+ "username": "snoopdogg",
2166
+ "full_name": "Snoop Dogg",
2167
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1574083_75sq_1295469061.jpg",
2168
+ "bio": "This is my bio",
2169
+ "website": "http://snoopdogg.com",
2170
+ "counts": {
2171
+ "media": 1320,
2172
+ "follows": 420,
2173
+ "followed_by": 3410
2174
+ }
2175
+ }
2176
+ }
2177
+ # Follows
2178
+ /follows:
2179
+ securedBy: [ oauth_2_0: { scopes: [ relationships ] } ]
2180
+ type: base
2181
+ get:
2182
+ description: Get the list of users this user follows.
2183
+ responses:
2184
+ 200:
2185
+ body:
2186
+ schema: |
2187
+ {
2188
+ "": "http://json-schema.org/draft-03/schema",
2189
+ "type": "object",
2190
+ "properties": {
2191
+ "data": [
2192
+ {
2193
+ "properties": {
2194
+ "username": {
2195
+ "type": "string"
2196
+ },
2197
+ "first_name": {
2198
+ "type": "string"
2199
+ },
2200
+ "profile_picture": {
2201
+ "type": "string"
2202
+ },
2203
+ "id": {
2204
+ "type": "string"
2205
+ },
2206
+ "last_name": {
2207
+ "type": "string"
2208
+ }
2209
+ },
2210
+ "type": "object"
2211
+ }
2212
+ ],
2213
+ "type": "array"
2214
+ }
2215
+ }
2216
+ example: |
2217
+ {
2218
+ "data": [{
2219
+ "username": "jack",
2220
+ "first_name": "Jack",
2221
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_66_75sq.jpg",
2222
+ "id": "66",
2223
+ "last_name": "Dorsey"
2224
+ },
2225
+ {
2226
+ "username": "sammyjack",
2227
+ "first_name": "Sammy",
2228
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_29648_75sq_1294520029.jpg",
2229
+ "id": "29648",
2230
+ "last_name": "Jack"
2231
+ },
2232
+ {
2233
+ "username": "jacktiddy",
2234
+ "first_name": "Jack",
2235
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_13096_75sq_1286441317.jpg",
2236
+ "id": "13096",
2237
+ "last_name": "Tiddy"
2238
+ }]
2239
+ }
2240
+ # Followed by
2241
+ /followed-by:
2242
+ securedBy: [ oauth_2_0: { scopes: [ relationships ] } ]
2243
+ type: base
2244
+ get:
2245
+ description: Get the list of users this user is followed by.
2246
+ responses:
2247
+ 200:
2248
+ body:
2249
+ schema: |
2250
+ {
2251
+ "": "http://json-schema.org/draft-03/schema",
2252
+ "type": "object",
2253
+ "properties": {
2254
+ "data": [
2255
+ {
2256
+ "properties": {
2257
+ "username": {
2258
+ "type": "string"
2259
+ },
2260
+ "first_name": {
2261
+ "type": "string"
2262
+ },
2263
+ "profile_picture": {
2264
+ "type": "string"
2265
+ },
2266
+ "id": {
2267
+ "type": "string"
2268
+ },
2269
+ "last_name": {
2270
+ "type": "string"
2271
+ }
2272
+ },
2273
+ "type": "object"
2274
+ }
2275
+ ],
2276
+ "type": "array"
2277
+ }
2278
+ }
2279
+ example: |
2280
+ {
2281
+ "data": [{
2282
+ "username": "jack",
2283
+ "first_name": "Jack",
2284
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_66_75sq.jpg",
2285
+ "id": "66",
2286
+ "last_name": "Dorsey"
2287
+ },
2288
+ {
2289
+ "username": "sammyjack",
2290
+ "first_name": "Sammy",
2291
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_29648_75sq_1294520029.jpg",
2292
+ "id": "29648",
2293
+ "last_name": "Jack"
2294
+ },
2295
+ {
2296
+ "username": "jacktiddy",
2297
+ "first_name": "Jack",
2298
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_13096_75sq_1286441317.jpg",
2299
+ "id": "13096",
2300
+ "last_name": "Tiddy"
2301
+ }]
2302
+ }
2303
+ # Requested by
2304
+ /self/requested-by:
2305
+ securedBy: [ oauth_2_0: { scopes: [ relationships ] } ]
2306
+ get:
2307
+ description: List the users who have requested this user's permission to follow.
2308
+ responses:
2309
+ 200:
2310
+ body:
2311
+ schema: |
2312
+ {
2313
+ "": "http://json-schema.org/draft-03/schema",
2314
+ "type": "object",
2315
+ "properties": {
2316
+ "meta": {
2317
+ "properties": {
2318
+ "code": {
2319
+ "type": "integer"
2320
+ }
2321
+ },
2322
+ "type": "object"
2323
+ },
2324
+ "data": [
2325
+ {
2326
+ "properties": {
2327
+ "username": {
2328
+ "type": "string"
2329
+ },
2330
+ "profile_picture": {
2331
+ "type": "string"
2332
+ },
2333
+ "id": {
2334
+ "type": "string"
2335
+ }
2336
+ },
2337
+ "type": "object"
2338
+ }
2339
+ ]
2340
+ }
2341
+ }
2342
+ example: |
2343
+ {
2344
+ "meta": {
2345
+ "code": 200
2346
+ },
2347
+ "data": [
2348
+ {
2349
+ "username": "mikeyk",
2350
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4_75sq_1292324747_debug.jpg",
2351
+ "id": "4"
2352
+ }
2353
+ ]
2354
+ }
2355
+ /media/recent:
2356
+ type: base
2357
+ get:
2358
+ is: [ limitableById, limitableByTime ]
2359
+ description: |
2360
+ See the authenticated user's feed. May return a mix of both image and
2361
+ video types.
2362
+ responses:
2363
+ 200:
2364
+ body:
2365
+ example: |
2366
+ {
2367
+ "data": [{
2368
+ "location": {
2369
+ "id": "833",
2370
+ "latitude": 37.77956816727314,
2371
+ "longitude": -122.41387367248539,
2372
+ "name": "Civic Center BART"
2373
+ },
2374
+ "comments": {
2375
+ "count": 16,
2376
+ "data": [ ... ]
2377
+ },
2378
+ "caption": null,
2379
+ "link": "http://instagr.am/p/BXsFz/",
2380
+ "likes": {
2381
+ "count": 190,
2382
+ "data": [{
2383
+ "username": "shayne",
2384
+ "full_name": "Shayne Sweeney",
2385
+ "id": "20",
2386
+ "profile_picture": "..."
2387
+ }, {...subset of likers...}]
2388
+ },
2389
+ "created_time": "1296748524",
2390
+ "images": {
2391
+ "low_resolution": {
2392
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_6.jpg",
2393
+ "width": 306,
2394
+ "height": 306
2395
+ },
2396
+ "thumbnail": {
2397
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_5.jpg",
2398
+ "width": 150,
2399
+ "height": 150
2400
+ },
2401
+ "standard_resolution": {
2402
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_7.jpg",
2403
+ "width": 612,
2404
+ "height": 612
2405
+ }
2406
+ },
2407
+ "type": "image",
2408
+ "users_in_photo": [],
2409
+ "filter": "Earlybird",
2410
+ "tags": [],
2411
+ "id": "22987123",
2412
+ "user": {
2413
+ "username": "kevin",
2414
+ "full_name": "Kevin S",
2415
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
2416
+ "id": "3"
2417
+ }
2418
+ },
2419
+ {
2420
+ "videos": {
2421
+ "low_resolution": {
2422
+ "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
2423
+ "width": 480,
2424
+ "height": 480
2425
+ },
2426
+ "standard_resolution": {
2427
+ "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
2428
+ "width": 640,
2429
+ "height": 640
2430
+ },
2431
+ "comments": {
2432
+ "data": [{
2433
+ "created_time": "1279332030",
2434
+ "text": "Love the sign here",
2435
+ "from": {
2436
+ "username": "mikeyk",
2437
+ "full_name": "Mikey Krieger",
2438
+ "id": "4",
2439
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1242695_75sq_1293915800.jpg"
2440
+ },
2441
+ "id": "8"
2442
+ },
2443
+ {
2444
+ "created_time": "1279341004",
2445
+ "text": "Chilako taco",
2446
+ "from": {
2447
+ "username": "kevin",
2448
+ "full_name": "Kevin S",
2449
+ "id": "3",
2450
+ "profile_picture": "..."
2451
+ },
2452
+ "id": "3"
2453
+ }],
2454
+ "count": 2
2455
+ },
2456
+ "caption": null,
2457
+ "likes": {
2458
+ "count": 1,
2459
+ "data": [{
2460
+ "username": "mikeyk",
2461
+ "full_name": "Mikeyk",
2462
+ "id": "4",
2463
+ "profile_picture": "..."
2464
+ }]
2465
+ },
2466
+ "link": "http://instagr.am/p/D/",
2467
+ "created_time": "1279340983",
2468
+ "images": {
2469
+ "low_resolution": {
2470
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
2471
+ "width": 306,
2472
+ "height": 306
2473
+ },
2474
+ "thumbnail": {
2475
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
2476
+ "width": 150,
2477
+ "height": 150
2478
+ },
2479
+ "standard_resolution": {
2480
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
2481
+ "width": 612,
2482
+ "height": 612
2483
+ }
2484
+ },
2485
+ "type": "video",
2486
+ "users_in_photo": null,
2487
+ "filter": "Vesper",
2488
+ "tags": [],
2489
+ "id": "363839373298",
2490
+ "user": {
2491
+ "username": "kevin",
2492
+ "full_name": "Kevin S",
2493
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
2494
+ "id": "3"
2495
+ },
2496
+ "location": null
2497
+ },
2498
+ ...]
2499
+ }
2500
+ /relationship:
2501
+ securedBy: [ oauth_2_0: { scopes: [ relationships ] } ]
2502
+ type: base
2503
+ get:
2504
+ description: Get information about a relationship to another user.
2505
+ responses:
2506
+ 200:
2507
+ body:
2508
+ schema: |
2509
+ {
2510
+ "": "http://json-schema.org/draft-03/schema",
2511
+ "type": "object",
2512
+ "properties": {
2513
+ "meta": {
2514
+ "properties": {
2515
+ "code": {
2516
+ "type": "integer"
2517
+ }
2518
+ },
2519
+ "type": "object"
2520
+ },
2521
+ "data": {
2522
+ "properties": {
2523
+ "outgoing_status": {
2524
+ "enum": [
2525
+ "follows",
2526
+ "requested",
2527
+ "none"
2528
+ ]
2529
+ },
2530
+ "incoming_status": {
2531
+ "enum": [
2532
+ "followed_by",
2533
+ "requested_by",
2534
+ "blocked_by_you",
2535
+ "none"
2536
+ ]
2537
+ }
2538
+ },
2539
+ "type": "object"
2540
+ }
2541
+ }
2542
+ }
2543
+ example: |
2544
+ {
2545
+ "meta": {
2546
+ "code": 200
2547
+ },
2548
+ "data": {
2549
+ "outgoing_status": "none",
2550
+ "incoming_status": "requested_by"
2551
+ }
2552
+ }
2553
+ post:
2554
+ description: Modify the relationship between the current user and the target user.
2555
+ body:
2556
+ formParameters:
2557
+ action:
2558
+ description: One of follow/unfollow/block/unblock/approve/deny.
2559
+ enum:
2560
+ - follow
2561
+ - unfollow
2562
+ - block
2563
+ - unblock
2564
+ - approve
2565
+ - deny
2566
+ responses:
2567
+ 200:
2568
+ body:
2569
+ schema: |
2570
+ {
2571
+ "": "http://json-schema.org/draft-03/schema",
2572
+ "type": "object",
2573
+ "properties": {
2574
+ "meta": {
2575
+ "properties": {
2576
+ "code": {
2577
+ "type": "integer"
2578
+ }
2579
+ },
2580
+ "type": "object"
2581
+ },
2582
+ "data": {
2583
+ "properties": {
2584
+ "outgoing_status": {
2585
+ "enum": [
2586
+ "follows",
2587
+ "requested",
2588
+ "none"
2589
+ ]
2590
+ },
2591
+ "incoming_status": {
2592
+ "enum": [
2593
+ "followed_by",
2594
+ "requested_by",
2595
+ "blocked_by_you",
2596
+ "none"
2597
+ ]
2598
+ }
2599
+ },
2600
+ "type": "object"
2601
+ }
2602
+ }
2603
+ }
2604
+ example: |
2605
+ {
2606
+ "meta": {
2607
+ "code": 200
2608
+ },
2609
+ "data": {
2610
+ "outgoing_status": "none",
2611
+ "incoming_status": "requested_by"
2612
+ }
2613
+ }
2614
+ /search:
2615
+ type: base
2616
+ get:
2617
+ description: Search for a user by name.
2618
+ queryParameters:
2619
+ q:
2620
+ description: A query string.
2621
+ type: string
2622
+ required: true
2623
+ count:
2624
+ description: Number of users to return.
2625
+ type: integer
2626
+ responses:
2627
+ 200:
2628
+ body:
2629
+ schema: |
2630
+ {
2631
+ "": "http://json-schema.org/draft-03/schema",
2632
+ "type": "object",
2633
+ "properties": {
2634
+ "data": [
2635
+ {
2636
+ "properties": {
2637
+ "username": {
2638
+ "type": "string"
2639
+ },
2640
+ "first_name": {
2641
+ "type": "string"
2642
+ },
2643
+ "profile_picture": {
2644
+ "type": "string"
2645
+ },
2646
+ "id": {
2647
+ "type": "string"
2648
+ },
2649
+ "last_name": {
2650
+ "type": "string"
2651
+ }
2652
+ },
2653
+ "type": "object"
2654
+ }
2655
+ ],
2656
+ "type": "array"
2657
+ }
2658
+ }
2659
+ example: |
2660
+ {
2661
+ "data": [{
2662
+ "username": "jack",
2663
+ "first_name": "Jack",
2664
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_66_75sq.jpg",
2665
+ "id": "66",
2666
+ "last_name": "Dorsey"
2667
+ },
2668
+ {
2669
+ "username": "sammyjack",
2670
+ "first_name": "Sammy",
2671
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_29648_75sq_1294520029.jpg",
2672
+ "id": "29648",
2673
+ "last_name": "Jack"
2674
+ },
2675
+ {
2676
+ "username": "jacktiddy",
2677
+ "first_name": "Jack",
2678
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_13096_75sq_1286441317.jpg",
2679
+ "id": "13096",
2680
+ "last_name": "Tiddy"
2681
+ }]
2682
+ }
2683
+ /self:
2684
+ /feed:
2685
+ type: base
2686
+ get:
2687
+ is: [ limitableById ]
2688
+ description: |
2689
+ See the authenticated user's feed. May return a mix of both image and
2690
+ video types.
2691
+ responses:
2692
+ 200:
2693
+ body:
2694
+ example: |
2695
+ {
2696
+ "data": [{
2697
+ "location": {
2698
+ "id": "833",
2699
+ "latitude": 37.77956816727314,
2700
+ "longitude": -122.41387367248539,
2701
+ "name": "Civic Center BART"
2702
+ },
2703
+ "comments": {
2704
+ "count": 16,
2705
+ "data": [ ... ]
2706
+ },
2707
+ "caption": null,
2708
+ "link": "http://instagr.am/p/BXsFz/",
2709
+ "likes": {
2710
+ "count": 190,
2711
+ "data": [{
2712
+ "username": "shayne",
2713
+ "full_name": "Shayne Sweeney",
2714
+ "id": "20",
2715
+ "profile_picture": "..."
2716
+ }, {...subset of likers...}]
2717
+ },
2718
+ "created_time": "1296748524",
2719
+ "images": {
2720
+ "low_resolution": {
2721
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_6.jpg",
2722
+ "width": 306,
2723
+ "height": 306
2724
+ },
2725
+ "thumbnail": {
2726
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_5.jpg",
2727
+ "width": 150,
2728
+ "height": 150
2729
+ },
2730
+ "standard_resolution": {
2731
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_7.jpg",
2732
+ "width": 612,
2733
+ "height": 612
2734
+ }
2735
+ },
2736
+ "type": "image",
2737
+ "users_in_photo": [],
2738
+ "filter": "Earlybird",
2739
+ "tags": [],
2740
+ "id": "22987123",
2741
+ "user": {
2742
+ "username": "kevin",
2743
+ "full_name": "Kevin S",
2744
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
2745
+ "id": "3"
2746
+ }
2747
+ },
2748
+ {
2749
+ "videos": {
2750
+ "low_resolution": {
2751
+ "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
2752
+ "width": 480,
2753
+ "height": 480
2754
+ },
2755
+ "standard_resolution": {
2756
+ "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
2757
+ "width": 640,
2758
+ "height": 640
2759
+ },
2760
+ "comments": {
2761
+ "data": [{
2762
+ "created_time": "1279332030",
2763
+ "text": "Love the sign here",
2764
+ "from": {
2765
+ "username": "mikeyk",
2766
+ "full_name": "Mikey Krieger",
2767
+ "id": "4",
2768
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1242695_75sq_1293915800.jpg"
2769
+ },
2770
+ "id": "8"
2771
+ },
2772
+ {
2773
+ "created_time": "1279341004",
2774
+ "text": "Chilako taco",
2775
+ "from": {
2776
+ "username": "kevin",
2777
+ "full_name": "Kevin S",
2778
+ "id": "3",
2779
+ "profile_picture": "..."
2780
+ },
2781
+ "id": "3"
2782
+ }],
2783
+ "count": 2
2784
+ },
2785
+ "caption": null,
2786
+ "likes": {
2787
+ "count": 1,
2788
+ "data": [{
2789
+ "username": "mikeyk",
2790
+ "full_name": "Mikeyk",
2791
+ "id": "4",
2792
+ "profile_picture": "..."
2793
+ }]
2794
+ },
2795
+ "link": "http://instagr.am/p/D/",
2796
+ "created_time": "1279340983",
2797
+ "images": {
2798
+ "low_resolution": {
2799
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
2800
+ "width": 306,
2801
+ "height": 306
2802
+ },
2803
+ "thumbnail": {
2804
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
2805
+ "width": 150,
2806
+ "height": 150
2807
+ },
2808
+ "standard_resolution": {
2809
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
2810
+ "width": 612,
2811
+ "height": 612
2812
+ }
2813
+ },
2814
+ "type": "video",
2815
+ "users_in_photo": null,
2816
+ "filter": "Vesper",
2817
+ "tags": [],
2818
+ "id": "363839373298",
2819
+ "user": {
2820
+ "username": "kevin",
2821
+ "full_name": "Kevin S",
2822
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
2823
+ "id": "3"
2824
+ },
2825
+ "location": null
2826
+ },
2827
+ ...]
2828
+ }
2829
+ /media/liked:
2830
+ type: base
2831
+ get:
2832
+ description: |
2833
+ See the authenticated user's list of media they've liked. May return a mix
2834
+ of both image and video types.
2835
+ Note: This list is ordered by the order in which the user liked the media.
2836
+ Private media is returned as long as the authenticated user has permission
2837
+ to view that media. Liked media lists are only available for the currently
2838
+ authenticated user.
2839
+ queryParameters:
2840
+ max_like_id:
2841
+ description: Return media liked before this id.
2842
+ type: integer
2843
+ responses:
2844
+ 200:
2845
+ body:
2846
+ example: |
2847
+ {
2848
+ "data": [{
2849
+ "location": {
2850
+ "id": "833",
2851
+ "latitude": 37.77956816727314,
2852
+ "longitude": -122.41387367248539,
2853
+ "name": "Civic Center BART"
2854
+ },
2855
+ "comments": {
2856
+ "count": 16,
2857
+ "data": [ ... ]
2858
+ },
2859
+ "caption": null,
2860
+ "link": "http://instagr.am/p/BXsFz/",
2861
+ "likes": {
2862
+ "count": 190,
2863
+ "data": [{
2864
+ "username": "shayne",
2865
+ "full_name": "Shayne Sweeney",
2866
+ "id": "20",
2867
+ "profile_picture": "..."
2868
+ }, {...subset of likers...}]
2869
+ },
2870
+ "created_time": "1296748524",
2871
+ "images": {
2872
+ "low_resolution": {
2873
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_6.jpg",
2874
+ "width": 306,
2875
+ "height": 306
2876
+ },
2877
+ "thumbnail": {
2878
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_5.jpg",
2879
+ "width": 150,
2880
+ "height": 150
2881
+ },
2882
+ "standard_resolution": {
2883
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_7.jpg",
2884
+ "width": 612,
2885
+ "height": 612
2886
+ }
2887
+ },
2888
+ "type": "image",
2889
+ "users_in_photo": [],
2890
+ "filter": "Earlybird",
2891
+ "tags": [],
2892
+ "id": "22987123",
2893
+ "user": {
2894
+ "username": "kevin",
2895
+ "full_name": "Kevin S",
2896
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
2897
+ "id": "3"
2898
+ }
2899
+ },
2900
+ {
2901
+ "videos": {
2902
+ "low_resolution": {
2903
+ "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
2904
+ "width": 480,
2905
+ "height": 480
2906
+ },
2907
+ "standard_resolution": {
2908
+ "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
2909
+ "width": 640,
2910
+ "height": 640
2911
+ },
2912
+ "comments": {
2913
+ "data": [{
2914
+ "created_time": "1279332030",
2915
+ "text": "Love the sign here",
2916
+ "from": {
2917
+ "username": "mikeyk",
2918
+ "full_name": "Mikey Krieger",
2919
+ "id": "4",
2920
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1242695_75sq_1293915800.jpg"
2921
+ },
2922
+ "id": "8"
2923
+ },
2924
+ {
2925
+ "created_time": "1279341004",
2926
+ "text": "Chilako taco",
2927
+ "from": {
2928
+ "username": "kevin",
2929
+ "full_name": "Kevin S",
2930
+ "id": "3",
2931
+ "profile_picture": "..."
2932
+ },
2933
+ "id": "3"
2934
+ }],
2935
+ "count": 2
2936
+ },
2937
+ "caption": null,
2938
+ "likes": {
2939
+ "count": 1,
2940
+ "data": [{
2941
+ "username": "mikeyk",
2942
+ "full_name": "Mikeyk",
2943
+ "id": "4",
2944
+ "profile_picture": "..."
2945
+ }]
2946
+ },
2947
+ "link": "http://instagr.am/p/D/",
2948
+ "created_time": "1279340983",
2949
+ "images": {
2950
+ "low_resolution": {
2951
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
2952
+ "width": 306,
2953
+ "height": 306
2954
+ },
2955
+ "thumbnail": {
2956
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
2957
+ "width": 150,
2958
+ "height": 150
2959
+ },
2960
+ "standard_resolution": {
2961
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
2962
+ "width": 612,
2963
+ "height": 612
2964
+ }
2965
+ },
2966
+ "type": "video",
2967
+ "users_in_photo": null,
2968
+ "filter": "Vesper",
2969
+ "tags": [],
2970
+ "id": "363839373298",
2971
+ "user": {
2972
+ "username": "kevin",
2973
+ "full_name": "Kevin S",
2974
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
2975
+ "id": "3"
2976
+ },
2977
+ "location": null
2978
+ },
2979
+ ...]
2980
+ }
2981
+ # Oembed
2982
+ /oembed:
2983
+ type: base
2984
+ get:
2985
+ description: |
2986
+ Given a short link, returns information about the media associated with
2987
+ that link.
2988
+ queryParameters:
2989
+ url:
2990
+ type: string
2991
+ maxheight:
2992
+ type: integer
2993
+ maxwidth:
2994
+ type: integer
2995
+ responses:
2996
+ 200:
2997
+ body:
2998
+ schema: |
2999
+ {
3000
+ "": "http://json-schema.org/draft-03/schema",
3001
+ "type": "object",
3002
+ "properties": {
3003
+ "author_id": {
3004
+ "type": "integer"
3005
+ },
3006
+ "author_name": {
3007
+ "type": "string"
3008
+ },
3009
+ "author_url": {
3010
+ "type": "string"
3011
+ },
3012
+ "height": {
3013
+ "type": "integer"
3014
+ },
3015
+ "media_id": {
3016
+ "type": "string"
3017
+ },
3018
+ "provider_name": {
3019
+ "type": "string"
3020
+ },
3021
+ "provider_url": {
3022
+ "type": "string"
3023
+ },
3024
+ "title": {
3025
+ "type": "string"
3026
+ },
3027
+ "type": {
3028
+ "type": "string"
3029
+ },
3030
+ "url": {
3031
+ "type": "string"
3032
+ },
3033
+ "version": {
3034
+ "type": "string"
3035
+ },
3036
+ "width": {
3037
+ "type": "integer"
3038
+ }
3039
+ }
3040
+ }
3041
+ example: |
3042
+ {
3043
+ "author_id": 72,
3044
+ "author_name": "danrubin",
3045
+ "author_url": "http://instagram.com/",
3046
+ "height": 612,
3047
+ "media_id": "5382_72",
3048
+ "provider_name": "Instagram",
3049
+ "provider_url": "http://instagram.com/",
3050
+ "title": "Rays",
3051
+ "type": "photo",
3052
+ "url": "http://distillery.s3.amazonaws.com/media/2010/10/02/7e4051fdcf1d45ab9bc1fba2582c0c6b_7.jpg",
3053
+ "version": "1.0",
3054
+ "width": 612
3055
+ }
3056
+ /p/{shortcode}/media:
3057
+ uriParameters:
3058
+ shortcode:
3059
+ type: string
3060
+ required: true
3061
+ type: base
3062
+ get:
3063
+ description: |
3064
+ Given a short link, issues a redirect to that media's JPG file.
3065
+ queryParameters:
3066
+ size:
3067
+ enum:
3068
+ - t,
3069
+ - m,
3070
+ - l
3071
+ default: m
3072
+ responses:
3073
+ 302:
3074
+ body:
3075
+ text/html:
3076
+ example: |
3077
+ HTTP/1.1 302 FOUND
3078
+ Location: http://distillery.s3.amazonaws.com/media/2010/10/02/7e4051fdcf1d45ab9bc1fba2582c0c6b_6.jpg
3079
+ # Locations
3080
+ /locations:
3081
+ /{locId}:
3082
+ uriParameters:
3083
+ locId:
3084
+ type: integer
3085
+ get:
3086
+ description: Get information about a location.
3087
+ /media/recent:
3088
+ type: base
3089
+ get:
3090
+ is: [ limitableById, limitableByTime ]
3091
+ description: |
3092
+ Get a list of recent media objects from a given location. May return a
3093
+ mix of both image and video types.
3094
+ responses:
3095
+ 200:
3096
+ body:
3097
+ example: |
3098
+ {
3099
+ "data": [{
3100
+ "location": {
3101
+ "id": "833",
3102
+ "latitude": 37.77956816727314,
3103
+ "longitude": -122.41387367248539,
3104
+ "name": "Civic Center BART"
3105
+ },
3106
+ "comments": {
3107
+ "count": 16,
3108
+ "data": [ ... ]
3109
+ },
3110
+ "caption": null,
3111
+ "link": "http://instagr.am/p/BXsFz/",
3112
+ "likes": {
3113
+ "count": 190,
3114
+ "data": [{
3115
+ "username": "shayne",
3116
+ "full_name": "Shayne Sweeney",
3117
+ "id": "20",
3118
+ "profile_picture": "..."
3119
+ }, {...subset of likers...}]
3120
+ },
3121
+ "created_time": "1296748524",
3122
+ "images": {
3123
+ "low_resolution": {
3124
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_6.jpg",
3125
+ "width": 306,
3126
+ "height": 306
3127
+ },
3128
+ "thumbnail": {
3129
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_5.jpg",
3130
+ "width": 150,
3131
+ "height": 150
3132
+ },
3133
+ "standard_resolution": {
3134
+ "url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_7.jpg",
3135
+ "width": 612,
3136
+ "height": 612
3137
+ }
3138
+ },
3139
+ "type": "image",
3140
+ "users_in_photo": [],
3141
+ "filter": "Earlybird",
3142
+ "tags": [],
3143
+ "id": "22987123",
3144
+ "user": {
3145
+ "username": "kevin",
3146
+ "full_name": "Kevin S",
3147
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
3148
+ "id": "3"
3149
+ }
3150
+ },
3151
+ {
3152
+ "videos": {
3153
+ "low_resolution": {
3154
+ "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
3155
+ "width": 480,
3156
+ "height": 480
3157
+ },
3158
+ "standard_resolution": {
3159
+ "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
3160
+ "width": 640,
3161
+ "height": 640
3162
+ },
3163
+ "comments": {
3164
+ "data": [{
3165
+ "created_time": "1279332030",
3166
+ "text": "Love the sign here",
3167
+ "from": {
3168
+ "username": "mikeyk",
3169
+ "full_name": "Mikey Krieger",
3170
+ "id": "4",
3171
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1242695_75sq_1293915800.jpg"
3172
+ },
3173
+ "id": "8"
3174
+ },
3175
+ {
3176
+ "created_time": "1279341004",
3177
+ "text": "Chilako taco",
3178
+ "from": {
3179
+ "username": "kevin",
3180
+ "full_name": "Kevin S",
3181
+ "id": "3",
3182
+ "profile_picture": "..."
3183
+ },
3184
+ "id": "3"
3185
+ }],
3186
+ "count": 2
3187
+ },
3188
+ "caption": null,
3189
+ "likes": {
3190
+ "count": 1,
3191
+ "data": [{
3192
+ "username": "mikeyk",
3193
+ "full_name": "Mikeyk",
3194
+ "id": "4",
3195
+ "profile_picture": "..."
3196
+ }]
3197
+ },
3198
+ "link": "http://instagr.am/p/D/",
3199
+ "created_time": "1279340983",
3200
+ "images": {
3201
+ "low_resolution": {
3202
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
3203
+ "width": 306,
3204
+ "height": 306
3205
+ },
3206
+ "thumbnail": {
3207
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
3208
+ "width": 150,
3209
+ "height": 150
3210
+ },
3211
+ "standard_resolution": {
3212
+ "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
3213
+ "width": 612,
3214
+ "height": 612
3215
+ }
3216
+ },
3217
+ "type": "video",
3218
+ "users_in_photo": null,
3219
+ "filter": "Vesper",
3220
+ "tags": [],
3221
+ "id": "363839373298",
3222
+ "user": {
3223
+ "username": "kevin",
3224
+ "full_name": "Kevin S",
3225
+ "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
3226
+ "id": "3"
3227
+ },
3228
+ "location": null
3229
+ },
3230
+ ...]
3231
+ }
3232
+ /search:
3233
+ type: base
3234
+ get:
3235
+ #TODO oneOf
3236
+ description: Search for a location by geographic coordinate.
3237
+ queryParameters:
3238
+ lat:
3239
+ description: Latitude of the center search coordinate. If used, lng is required.
3240
+ type: number
3241
+ lng:
3242
+ description: Longitude of the center search coordinate. If used, lat is required.
3243
+ type: number
3244
+ distance:
3245
+ description: Default is 1000m (distance=1000), max distance is 5000.
3246
+ type: integer
3247
+ maximum: 5000
3248
+ default: 1000
3249
+ foursquare_v2_id:
3250
+ description: |
3251
+ Returns a location mapped off of a foursquare v2 api location id. If
3252
+ used, you are not required to use lat and lng.
3253
+ foursquare_id:
3254
+ description: |
3255
+ Returns a location mapped off of a foursquare v1 api location id. If used,
3256
+ you are not required to use lat and lng. Note that this method is deprecated;
3257
+ you should use the new foursquare IDs with V2 of their API.
3258
+ responses:
3259
+ 200:
3260
+ body:
3261
+ schema: |
3262
+ {
3263
+ "": "http://json-schema.org/draft-03/schema",
3264
+ "type": "object",
3265
+ "properties": {
3266
+ "meta": {
3267
+ "properties": {
3268
+ "code": {
3269
+ "type": "integer"
3270
+ }
3271
+ },
3272
+ "type": "object"
3273
+ },
3274
+ "data": [
3275
+ {
3276
+ "properties": {
3277
+ "latitude": {
3278
+ "type": "number"
3279
+ },
3280
+ "id": {
3281
+ "type": "string"
3282
+ },
3283
+ "longitude": {
3284
+ "type": "number"
3285
+ },
3286
+ "name": {
3287
+ "type": "string"
3288
+ }
3289
+ },
3290
+ "type": "object"
3291
+ }
3292
+ ]
3293
+ }
3294
+ }
3295
+ example: |
3296
+ {
3297
+ "meta": {
3298
+ "code": 200
3299
+ },
3300
+ "data": [
3301
+ {
3302
+ "latitude": 48.850059509,
3303
+ "id": "125983371",
3304
+ "longitude": 2.294613838,
3305
+ "name": "cairo universty, ElSheikh Zaid branch"
3306
+ },
3307
+ {
3308
+ "latitude": 48.850191,
3309
+ "id": "46295095",
3310
+ "longitude": 2.294195,
3311
+ "name": "82 Boulevard De Grenelle"
3312
+ },
3313
+ {
3314
+ "latitude": 48.850232,
3315
+ "id": "17463171",
3316
+ "longitude": 2.294276,
3317
+ "name": "Monan chaussure"
3318
+ },
3319
+ {
3320
+ "latitude": 48.849993048,
3321
+ "id": "58664053",
3322
+ "longitude": 2.294816312,
3323
+ "name": "Rue Juge"
3324
+ },
3325
+ {
3326
+ "latitude": 48.850235602,
3327
+ "id": "3277432",
3328
+ "longitude": 2.294731778,
3329
+ "name": "Pizza Di Napoli"
3330
+ },
3331
+ {
3332
+ "latitude": 48.85030795,
3333
+ "id": "3632655",
3334
+ "longitude": 2.294114341,
3335
+ "name": "Marche Grenelle"
3336
+ },
3337
+ {
3338
+ "latitude": 48.850311575,
3339
+ "id": "47202559",
3340
+ "longitude": 2.294123981,
3341
+ "name": "London Styl'"
3342
+ },
3343
+ {
3344
+ "latitude": 48.84975,
3345
+ "id": "16095374",
3346
+ "longitude": 2.294726,
3347
+ "name": "Sami Coiffure 2000"
3348
+ }
3349
+ ]
3350
+ }
3351
+ # Geo
3352
+ /geographies/{geoId}/media/recent:
3353
+ type: base
3354
+ uriParameters:
3355
+ geoId:
3356
+ type: integer
3357
+ get:
3358
+ description: |
3359
+ Get recent media from a geography subscription that you created.
3360
+ Note: You can only access Geographies that were explicitly created by your
3361
+ OAuth client. Check the Geography Subscriptions section of the real-time
3362
+ updates page. When you create a subscription to some geography that you
3363
+ define, you will be returned a unique geo-id that can be used in this
3364
+ query. To backfill photos from the location covered by this geography,
3365
+ use the media search endpoint.
3366
+ queryParameters:
3367
+ min_id:
3368
+ description: Return media before this min_id.
3369
+ type: integer