├── .gitignore
├── .gitmodules
├── 500px-api.xml
├── README.md
├── authentication
├── POST_oauth_accesstoken.md
├── POST_oauth_authorize.md
├── POST_oauth_requesttoken.md
└── upload_key.md
├── basics
├── formats_and_terms.md
├── terms_of_use.md
└── upload.md
├── endpoints
├── collections
│ ├── DELETE_collections_id.md
│ ├── GET_collections.md
│ ├── GET_collections_id.md
│ ├── POST_collections.md
│ └── PUT_collections_id.md
├── comments
│ └── POST_comments_id_comments.md
├── galleries
│ ├── DELETE_galleries_id.md
│ ├── GET_galleries.md
│ ├── GET_galleries_id.md
│ ├── GET_galleries_id_items.md
│ ├── GET_galleries_id_share_url.md
│ ├── POST_galleries.md
│ ├── PUT_galleries_id.md
│ ├── PUT_galleries_id_items.md
│ └── PUT_galleries_reposition.md
├── photo
│ ├── DELETE_photos_id.md
│ ├── DELETE_photos_id_tags.md
│ ├── DELETE_photos_id_vote.md
│ ├── GET_photos.md
│ ├── GET_photos_id.md
│ ├── GET_photos_id_comments.md
│ ├── GET_photos_id_votes.md
│ ├── GET_photos_search.md
│ ├── POST_photos.md
│ ├── POST_photos_id_comments.md
│ ├── POST_photos_id_report.md
│ ├── POST_photos_id_tags.md
│ ├── POST_photos_id_vote.md
│ └── PUT_photos_id.md
├── template.md
└── user
│ ├── DELETE_users_id_friends.md
│ ├── GET_users.md
│ ├── GET_users_id_followers.md
│ ├── GET_users_id_friends.md
│ ├── GET_users_search.md
│ ├── GET_users_show.md
│ └── POST_users_id_friends.md
└── examples
├── PHP
└── PHP.md
├── Ruby
└── xauth.rb
└── iOS
├── API Tutorials.md
├── oauth_flowchart.png
└── oauth_post.png
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "examples/python-sdk"]
2 | path = examples/python-sdk
3 | url = git@github.com:500px/PxMagic.git
4 | [submodule "examples/android-sdk"]
5 | path = examples/android-sdk
6 | url = git@github.com:500px/500px-android-sdk.git
7 | [submodule "examples/iOS-sdk"]
8 | path = examples/iOS-sdk
9 | url = git@github.com:500px/500px-iOS-api.git
10 | [submodule "examples/TroubledPixels"]
11 | path = examples/TroubledPixels
12 | url = https://github.com/arthurnn/TroubledPixels
13 |
--------------------------------------------------------------------------------
/500px-api.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Photo stream.
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | User ID 'user' Photo streeam
28 |
29 |
30 |
31 | OR username for 'user' Photo streeam
32 |
33 |
34 |
35 | String name of the category to return photos from
36 |
37 |
38 |
39 | String name of the category to exclude photos by.
40 |
41 |
42 |
43 |
44 | Sort photos in the specified order.
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | Return a specific page in the photo stream. Page numbering is 1-based.
56 |
57 |
58 |
59 | The number of results to return. Can not be over 100, default 20.
60 |
61 |
62 |
63 |
64 | The photo size to be returned.
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | Returns market infomation about the photo.
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | Returns state of the photo for the currently logged in user and authenticated request.
83 |
84 |
85 |
86 |
87 |
88 |
89 | Returns an array of tags for the photo.
90 |
91 |
92 |
93 |
94 |
95 | Photos
96 | Show
97 |
98 |
99 |
100 |
101 |
102 |
103 | Retrieves list of photos
104 |
105 |
106 |
107 |
108 |
109 |
110 | A keyword to search for.
111 |
112 |
113 |
114 | A complete tag string to search for.
115 |
116 |
117 |
118 | Return a specific page. Page numbering is 1-based.
119 |
120 |
121 |
122 | The number of results to return. Can not be over 100, default 20.
123 |
124 |
125 |
126 | Returns an array of tags for each photo.
127 |
128 |
129 |
130 |
131 | Photos
132 |
133 |
134 |
135 | Returns a listing of twenty (up to one hundred) photos from search results for a specified tag or keyword.
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 | The Photo ID
145 |
146 |
147 |
148 |
149 | The photo size to be returned.
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 | Return comments to the photo in the response. Comments are returned in order of creation, 20 entries per page.
159 |
160 |
161 |
162 |
163 |
164 | Return the specified page from the comments listing. Page numbers are 1-based.
165 |
166 |
167 |
168 | Returns an array of tags for the photo.
169 |
170 |
171 |
172 |
173 | Photos
174 |
175 |
176 |
177 |
178 | Returns detailed information of a single photo.
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 | The Photo ID
187 |
188 |
189 |
190 | Return a specific page in the comment listing. Page numbering is 1-based.
191 |
192 |
193 |
203 |
204 |
205 |
206 |
207 |
208 | The Photo ID
209 |
210 |
211 |
212 | Return a specific page in the comment listing. Page numbering is 1-based.
213 |
214 |
215 |
216 | The number of results to return. Can not be over 100, default 20.
217 |
218 |
219 |
220 |
221 |
222 | Photos
223 | Photos
224 |
225 |
226 |
227 |
228 |
229 |
230 | Likes the photo
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 | The Photo ID
239 |
240 |
241 |
242 | The Photo ID to update.
243 |
244 |
245 |
246 | Title for the photo.
247 |
248 |
249 |
250 | The description of the photo.
251 |
252 |
253 |
254 |
255 | Photos
256 | Photos
257 |
258 |
259 |
260 |
261 |
262 |
263 | Updates a photo.
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 | Title for the photo.
273 |
274 |
275 |
276 | The description of the photo.
277 |
278 |
279 |
280 | A numerical ID for the Category of the photo
281 |
282 |
283 |
284 |
285 | Shutter speed in seconds, represented by string containing a rational expression if the value is 1sec.
286 |
287 |
288 |
289 | Focal length in millimetres, a string representing an integer value
290 |
291 |
292 |
293 | Aperture value
294 |
295 |
296 |
297 | ISO value
298 |
299 |
300 |
301 | Make and model of the camera. Note: Please make sure it contains sensible information (eg., does not contain camera's make or model twice)
302 |
303 |
304 |
305 | Lens used to make this photo
306 |
307 |
308 |
309 |
310 | Latitude, in decimal format
311 |
312 |
313 |
314 | Longitude, in decimal format
315 |
316 |
317 |
318 |
319 | Whether to hide the photo from the user profile on the website. Otherwise, the photo is only available for use in galleries. Recognized values: 1, 0.
320 |
321 |
322 |
323 |
324 |
325 | Photos
326 | Photos
327 |
328 |
329 |
330 |
331 |
332 |
333 | Create a new photo on behalf of the user, and receive an upload key in exchange.
334 |
335 |
336 |
337 |
338 |
339 |
340 | ID of the photo the vote is cast upon.
341 |
342 |
343 |
344 |
345 | vote, values: '0' for 'dislike' or '1' for 'like'.
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 | Photos
354 |
355 |
356 |
357 |
358 | Allows the user to vote for a photo.
359 |
360 |
361 |
362 |
363 |
364 |
365 | The Photo ID to add tags for.
366 |
367 |
368 |
369 | Coma separated tags.
370 |
371 |
372 |
373 |
374 | Photos
375 |
376 |
377 |
378 |
379 | Adds tags to the photo. Accepts one or multiple coma separated tags.
380 |
381 |
382 |
383 |
384 |
385 |
386 | The Photo ID to post comments for.
387 |
388 |
389 |
390 | Content of the comment.
391 |
392 |
393 |
403 |
404 |
405 |
406 |
407 | The Photo ID to delete.
408 |
409 |
410 |
411 |
412 | Photos
413 |
414 |
415 |
416 |
417 | Deletes the photo from the User's library.
418 |
419 |
420 |
421 |
422 |
423 |
424 | The Photo ID to remove tags from.
425 |
426 |
427 |
428 | Coma separated tags.
429 |
430 |
431 |
432 |
433 | Photos
434 |
435 |
436 |
437 |
438 | Removes tags from the photo. Accepts one or multiple coma separated tags.
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 | The ID of the photo the file is being uploaded for. The ID should be known to the client from the POST photos request result.
447 |
448 |
449 | Upload key
450 |
451 |
452 |
453 | Your application Consumer key.
454 |
455 |
456 |
457 | Oauth token.
458 |
459 |
460 |
461 | The multipart HTTP upload. This is expected to be of the same format as when a file is being sent from an HTML file form.
462 |
463 |
464 |
465 |
466 | Upload
467 |
468 |
469 |
470 |
471 | Allows an application to upload the photo file.
472 | Warning: This endpoint cannot accept oauth signed requests.
473 |
474 |
475 |
476 |
477 |
478 |
479 | The multipart HTTP upload. This is expected to be of the same format as when a file is being sent from an HTML file form.
480 |
481 |
482 |
483 |
484 | Title for the photo.
485 |
486 |
487 |
488 | The description of the photo.
489 |
490 |
491 |
492 | A numerical ID for the Category of the photo
493 |
494 |
495 |
496 | Whether to hide the photo from the user profile on the website. Otherwise, the photo is only available for use in Collections/Portfolio. 0 - Public, 1 - Private
497 |
498 |
499 |
500 |
501 |
502 |
503 | Shutter speed in seconds, represented by string containing a rational expression if the value is 1sec.
504 |
505 |
506 |
507 | Focal length in millimetres, a string representing an integer value
508 |
509 |
510 |
511 | Aperture value
512 |
513 |
514 |
515 | ISO value
516 |
517 |
518 |
519 | Make and model of the camera. Note: Please make sure it contains sensible information (eg., does not contain camera's make or model twice)
520 |
521 |
522 |
523 | Lens used to make this photo
524 |
525 |
526 |
527 |
528 | Latitude, in decimal format
529 |
530 |
531 |
532 | Longitude, in decimal format
533 |
534 |
535 |
536 |
537 | Upload
538 |
539 |
540 |
541 |
542 | (This is a new, simplified upload endpoint.) Allows an application to upload the photo.
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 | User
553 |
554 |
555 |
556 |
557 | Returns the profile information for the current user.
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 | Return information for the specified user ID.
566 |
567 |
568 |
569 |
570 | Return information for the user with the specified username.
571 |
572 |
573 |
574 | Return information for the user with the specified email address.
575 |
576 |
577 |
578 |
579 |
580 | User
581 |
582 |
583 |
584 |
585 | Returns the profile information for a specified user.
586 |
587 |
588 |
589 |
590 |
591 |
592 | Return information for the specified user ID
593 |
594 |
595 |
596 | Return the specified page of the resource. Page numbering is 1-based.
597 |
598 |
599 |
600 | Results Per Page, default 20, max 100.
601 |
602 |
603 |
604 |
605 | User
606 |
607 |
608 |
609 |
610 | Returns a list of friends for the specified user.
611 |
612 |
613 |
614 |
615 |
616 |
617 | ID of the user.
618 |
619 |
620 |
621 | Return the specified page of the resource. Page numbering is 1-based.
622 |
623 |
624 |
625 |
626 | User
627 |
628 |
629 |
630 |
631 | Returns a list of users who follow the specified user.
632 |
633 |
634 |
635 |
636 |
637 |
638 | A keyword to search for.
639 |
640 |
641 |
642 | Return the specified page of the resource. Page numbering is 1-based.
643 |
644 |
645 |
646 | Results Per Page, default 20, max 100.
647 |
648 |
649 |
650 |
651 | User
652 |
653 |
654 |
655 |
656 | Return listing of ten (up to one hundred) users from search results for a specified search term.
657 |
658 |
659 |
660 |
661 |
662 |
663 | ID of the User to add to the followers list.
664 |
665 |
666 |
667 |
668 | User
669 |
670 |
671 |
672 |
673 | Add the user to the list of followers.
674 |
675 |
676 |
677 |
678 |
679 |
680 | ID of the User to remove from the followers list.
681 |
682 |
683 |
684 |
685 | User
686 |
687 |
688 |
689 |
690 | Removes the user from the list of followers.
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 500px API
2 |
3 | 500px API provides programmatic access to 500px functionality and content.
4 | Version 1 of the API is limited to the essentials of the website's functionality: viewing feature streams, photo information and comments, as well as user profiles.
5 |
6 | The API is [REST API](http://en.wikipedia.org/wiki/Representational_State_Transfer "RESTful")
7 | and uses [OAuth](http://oauth.net/ "OAuth") 1.0a for user authentication purposes.
8 | Currently, return format for all endpoints is [JSON](http://json.org/ "JSON").
9 |
10 | You can try our API in [console](http://bitly.com/api500px) ([http://bitly.com/api500px](http://bitly.com/api500px))
11 |
12 | See [status.500px.com](http://status.500px.com) for API status updates, outages, and scheduled maintenance.
13 |
14 | ***
15 |
16 | ## Basics
17 |
18 | - **[Formats and Terms](https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md)**
19 | - **[API Terms of Use](https://github.com/500px/api-documentation/blob/master/basics/terms_of_use.md)**
20 | - **[Uploading photos](https://github.com/500px/api-documentation/blob/master/basics/upload.md)**
21 |
22 |
23 | ## Examples
24 |
25 | - **[JavaScript](http://500px.github.com/500px-js-sdk)**
26 | - **[iOS](https://github.com/500px/api-documentation/blob/master/examples/iOS/API%20Tutorials.md)**
27 | - **[Ruby](https://github.com/500px/api-documentation/blob/master/examples/Ruby/)**
28 | - **[PHP](https://github.com/500px/api-documentation/blob/master/examples/PHP/PHP.md)**
29 |
30 | ## Changes
31 |
32 | * 2017-12-12 Deprecated the old upload flow with `upload_key` and [replaced with new one](https://github.com/500px/api-documentation/blob/master/basics/upload.md)
33 | * 2014-03-27 Deprecated photo object's image_url key.
34 |
35 | ## SDK
36 |
37 | - **[JavaScript](https://github.com/500px/500px-js-sdk)**
38 | - **[Android](https://github.com/500px/500px-android-sdk)**
39 | - **[iOS](https://github.com/500px/500px-iOS-api)**
40 |
41 | ## Endpoints
42 |
43 | #### Photo Resources
44 |
45 | - **[GET
photos](https://github.com/500px/api-documentation/blob/master/endpoints/photo/GET_photos.md)**
46 | - **[GET
photos/search](https://github.com/500px/api-documentation/blob/master/endpoints/photo/GET_photos_search.md)**
47 | - **[GET
photos/:id](https://github.com/500px/api-documentation/blob/master/endpoints/photo/GET_photos_id.md)**
48 | - **[GET
photos/:id/comments](https://github.com/500px/api-documentation/blob/master/endpoints/photo/GET_photos_id_comments.md)**
49 | - **[GET
photos/:id/votes](https://github.com/500px/api-documentation/blob/master/endpoints/photo/GET_photos_id_votes.md)**
50 | - **[PUT
photos/:id](https://github.com/500px/api-documentation/blob/master/endpoints/photo/PUT_photos_id.md)**
51 | - **[POST
photos](https://github.com/500px/api-documentation/blob/master/endpoints/photo/POST_photos.md)**
52 | - **[POST
photos/:id/vote](https://github.com/500px/api-documentation/blob/master/endpoints/photo/POST_photos_id_vote.md)**
53 | - **[DELETE
photos/:id/vote](https://github.com/500px/api-documentation/blob/master/endpoints/photo/DELETE_photos_id_vote.md)**
54 | - **[POST
photos/:id/tags](https://github.com/500px/api-documentation/blob/master/endpoints/photo/POST_photos_id_tags.md)**
55 | - **[POST
photos/:id/comments](https://github.com/500px/api-documentation/blob/master/endpoints/photo/POST_photos_id_comments.md)**
56 | - **[POST
photos/:id/report](https://github.com/500px/api-documentation/blob/master/endpoints/photo/POST_photos_id_report.md)**
57 | - **[DELETE
photos/:id](https://github.com/500px/api-documentation/blob/master/endpoints/photo/DELETE_photos_id.md)**
58 | - **[DELETE
photos/:id/tags](https://github.com/500px/api-documentation/blob/master/endpoints/photo/DELETE_photos_id_tags.md)**
59 |
60 | #### User Resources
61 |
62 | - **[GET
users](https://github.com/500px/api-documentation/blob/master/endpoints/user/GET_users.md)**
63 | - **[GET
users/show](https://github.com/500px/api-documentation/blob/master/endpoints/user/GET_users_show.md)**
64 | - **[GET
users/:id/friends](https://github.com/500px/api-documentation/blob/master/endpoints/user/GET_users_id_friends.md)**
65 | - **[GET
users/:id/followers](https://github.com/500px/api-documentation/blob/master/endpoints/user/GET_users_id_followers.md)**
66 | - **[GET
users/search](https://github.com/500px/api-documentation/blob/master/endpoints/user/GET_users_search.md)**
67 | - **[POST
users/:id/friends](https://github.com/500px/api-documentation/blob/master/endpoints/user/POST_users_id_friends.md)**
68 | - **[DELETE
users/:id/friends](https://github.com/500px/api-documentation/blob/master/endpoints/user/DELETE_users_id_friends.md)**
69 |
70 | #### Gallery Resources
71 |
72 | - **[GET
users/:user_id/galleries](https://github.com/500px/api-documentation/blob/master/endpoints/galleries/GET_galleries.md)**
73 | - **[GET
users/:user_id/galleries/:id](https://github.com/500px/api-documentation/blob/master/endpoints/galleries/GET_galleries_id.md)**
74 | - **[GET
users/:user_id/galleries/:id/items](https://github.com/500px/api-documentation/blob/master/endpoints/galleries/GET_galleries_id_items.md)**
75 | - **[GET
users/:user_id/galleries/:id/share_url](https://github.com/500px/api-documentation/blob/master/endpoints/galleries/GET_galleries_id.md)**
76 | - **[PUT
users/:user_id/galleries/:id](https://github.com/500px/api-documentation/blob/master/endpoints/galleries/PUT_galleries_id.md)**
77 | - **[PUT
users/:user_id/galleries/:id/items](https://github.com/500px/api-documentation/blob/master/endpoints/galleries/PUT_galleries_id_items.md)**
78 | - **[PUT
users/:user_id/galleries/reposition](https://github.com/500px/api-documentation/blob/master/endpoints/galleries/PUT_galleries_reposition.md)**
79 | - **[POST
users/:user_id/galleries](https://github.com/500px/api-documentation/blob/master/endpoints/galleries/POST_galleries.md)**
80 | - **[DELETE
users/:user_id/galleries/:id](https://github.com/500px/api-documentation/blob/master/endpoints/galleries/DELETE_galleries_id.md)**
81 |
82 | #### Collections/Sets Resources
83 |
84 | - **DEPRECATED**. Please use [Gallery Resources](#gallery-resources) instead
85 |
86 | #### Comment Resources
87 |
88 | - **[POST
comments/:id/comments](https://github.com/500px/api-documentation/blob/master/endpoints/comments/POST_comments_id_comments.md)**
89 |
90 | ## Directory API
91 |
92 | You can also programmatically access the [500px Directory](https://500px.com/directory). The Directory allows you to contact photographers and search for photographers by speciality, availability, service rates, language, camera, and other information. To gain access to the Directory API please contact sales@500px.com.
93 |
94 | ## Authentication
95 |
96 | - **[POST
oauth/request_token](https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_requesttoken.md)**
97 | - **[POST
oauth/authorize](https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_authorize.md)**
98 | - **[POST
oauth/access_token](https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_accesstoken.md)**
99 | - **[Upload key](https://github.com/500px/api-documentation/blob/master/authentication/upload_key.md)**
100 |
101 | ## FAQ
102 | ### What do I need to know before I start using the API?
103 | Got rust on your skills? No worries. Here are the docs you might need to get started:
104 |
105 | - HTTPS protocol
106 | - [REST software pattern][]
107 | - Authentication with [OAuth][] (or the official [Beginner’s Guide][])
108 | - Data serialization with [JSON][] (or see a [quick tutorial][])
109 |
110 | ### How do I connect to the 500px.com API?
111 | The API is only available to authenticated clients. Clients should authenticate users using [OAuth][]. Once authenticated, you need to request a resource from one of the endpoints using HTTPS. Generally, reading any data is done through a request with GET method. If you want our server to create, update or delete a given resource, POST or PUT methods are required.
112 |
113 | ### What return formats do you support?
114 | 500px API currently returns data in [JSON](http://json.org/ "JSON") format.
115 |
116 | ### What kind of authentication is required?
117 | Applications must identify themselves to access any resource.
118 | If your application only needs read-only access and does not authenticate the user, **consumer_key** containing a valid Consumer Key parameter should be specified in the query string. Otherwise, [OAuth](https://github.com/500px/api-documentation/tree/master/authentication) or upload key authentication takes care of identifying the application as well as the user accessing the API.
119 |
120 | ### Is there a request rate limit?
121 | There is a rate limit of 1,000,000 API requests per month per account. We will contact you and, if required, disable your application if we find that your application is exceeding this limit or interfering with our system's stability. This revised rate limit came into effect May 1, 2014.
122 |
123 | [REST software pattern]: http://en.wikipedia.org/wiki/Representational_State_Transfer
124 | [OAuth]: http://oauth.net/core/1.0a/
125 | [Beginner’s Guide]: http://hueniverse.com/oauth/
126 | [JSON]: http://json.org
127 | [quick tutorial]: http://www.webmonkey.com/2010/02/get_started_with_json/
128 | [Register your application]: http://500px.com/settings/applications
129 | [API Terms of Use]: https://github.com/500px/api-documentation/blob/master/basics/terms_of_use.md
130 | [See if the concepts used by the API are familiar to you]: https://github.com/500px/api-documentation#what-do-i-need-to-know-before-i-start-using-the-api
131 |
--------------------------------------------------------------------------------
/authentication/POST_oauth_accesstoken.md:
--------------------------------------------------------------------------------
1 | # OAuth
2 |
3 | POST oauth/access_token
4 |
5 | ## Description
6 | Allows a Consumer application to exchange an OAuth Request Token for an OAuth Access Token, which can be used to access protected resources on behalf of the user. This method fulfills [Section 6.3][] of the [OAuth 1.0 authentication flow][].
7 |
8 | The OAuth Access Token may also be used for xAuth operations.
9 |
10 | ***
11 |
12 | ## Requires authentication
13 | OAuth Request Token received using the [request_token][] method. Requires oauth_verifier when using [authorize](https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_authorize.modificator) in authentication workflow.
14 |
15 | Note that this request must be signed with a Request Token even when using the xAuth workflow.
16 |
17 | ***
18 |
19 | ## Parameters
20 | Standard oAuth workflow:
21 |
22 | - **oauth_callback** _(required)_ — A valid URL on the Consumer side the user should be redirected to once they authorize the request.
23 |
24 | xAuth workflow:
25 |
26 | - **x_auth_mode** _(required)_ — xAuth modificator. Recognized values: 'client_auth'.
27 | - **x_auth_username** _(required)_ — The username or email address of the user to obtain a token for.
28 | - **x_auth_password** _(required)_ — The password of the user for which to obtain a token for.
29 |
30 | ***
31 |
32 | ## Return format
33 | Text, containing an query string-encoded list of OAuth parameters.
34 |
35 | - **oauth_token** — An Access Token
36 | - **oauth_token_secret** — An Access Token's Secret
37 |
38 | ***
39 |
40 | ## Errors
41 |
42 | - **401 Invalid OAuth Request** — Request for the token was malformed or uses an unknown OAuth version
43 |
44 | [Section 6.3]: http://oauth.net/core/1.0/#auth_step3
45 | [OAuth 1.0 authentication flow]: http://oauth.net/core/1.0/#anchor9
46 | [request_token]: https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_requesttoken.md
47 |
--------------------------------------------------------------------------------
/authentication/POST_oauth_authorize.md:
--------------------------------------------------------------------------------
1 | # OAuth
2 |
3 | POST oauth/authorize
4 |
5 | ## Description
6 | Allows a Consumer application to obtain user authorization for an OAuth Request Token. This method fulfills [Section 6.2][] of the [OAuth 1.0 authentication flow][]. The method will use the currently logged in user as the account for access authorization and will request the user to log in if they have no active session with 500px.com.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | OAuth Request Token received using [request_token][] method.
12 |
13 | ***
14 |
15 | ## Parameters
16 |
17 | A valid OAuth request should be issued. You can provide parameters in Authorization HTTP-headers, query string, or body of the request. If you're using HTTP-header based OAuth, you shouldn't include oauth_*
parameters in the POST body or query string.
18 |
19 | - **oauth_token** _(required)_ — A Request Token received from [request_token][] method
20 | - **oauth_callback** _(required)_ — A valid URL on the Consumer side the user should be redirected to once they authorize the request
21 |
22 | ***
23 |
24 | ## Return format
25 | The user will be redirected to oauth_callback URL once they authorize the request. The request will contain two parameters:
26 |
27 | - **oauth_token** — A Request Token issued by the Provider at the [request_token][] step
28 | - **oauth_verifier** — The OAuth Verifier is a verification code tied to the Request Token. The OAuth Verifier and Request Token both must be provided in exchange for an Access Token.
29 |
30 | ***
31 |
32 | ## Errors
33 |
34 | - **401 Invalid OAuth Request** — Request for the token was malformed or uses an unknown OAuth version
35 |
36 | [Section 6.2]: http://oauth.net/core/1.0/#auth_step2
37 | [OAuth 1.0 authentication flow]: http://oauth.net/core/1.0/#anchor9
38 | [request_token]: https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_requesttoken.md
39 |
--------------------------------------------------------------------------------
/authentication/POST_oauth_requesttoken.md:
--------------------------------------------------------------------------------
1 | # OAuth
2 |
3 | POST oauth/request_token
4 |
5 | ## Description
6 | Allows a Consumer application to obtain an OAuth Request Token to request user authorization. This method fulfills [Section 6.1][] of the [OAuth 1.0 authentication flow][].
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | False
12 |
13 | ***
14 |
15 | ## Parameters
16 |
17 | A valid OAuth request should be issued. You can provide parameters in Authorization HTTP-headers, query string, or body of the request. If you're using HTTP-header based OAuth, you shouldn't include oauth_* parameters in the POST body or query string.
18 |
19 | - **oauth_callback** _(required)_ — A valid URL on the Consumer side the user should be redirected to once they authorize the request.
20 |
21 | ***
22 |
23 | ## Return format
24 | Text, containing an query string-encoded list of OAuth parameters.
25 |
26 | - **oauth_token** — A Request Token
27 | - **oauth_token_secret** — A Request Token's Secret
28 |
29 | ***
30 |
31 | ## Errors
32 |
33 | - **401 Invalid OAuth Request** — Request for the token was malformed or uses an unknown OAuth version
34 |
35 | [Section 6.1]: http://oauth.net/core/1.0/#auth_step1
36 | [OAuth 1.0 authentication flow]: http://oauth.net/core/1.0/#anchor9
37 |
--------------------------------------------------------------------------------
/authentication/upload_key.md:
--------------------------------------------------------------------------------
1 | # Upload key authorization
2 |
3 | OAuth does not support encoding multipart/form-data messages. As such, it is impossible to send a valid OAuth request containing file data without performing extra encoding. As a workaround, 500px.com API uses a separate request authentication schema for file uploads.
4 |
5 | ***
6 |
7 | ## Authentication requirements
8 | The party making the request is still required to obtain an OAuth Access Token through standard OAuth workflow, and must include OAuth consumer key and access token key in the request. Current upload authentication also requires obtaining an photo_id and upload_key values returned in response to a [POST photos][] request.
9 |
10 | ## Parameters
11 | To have an upload request authenticate successfully, the following parameters must be included:
12 |
13 | ## Return format
14 | Text, containing an query string-encoded list of OAuth parameters.
15 |
16 | - **consumer_key** — OAuth Consumer key of the application sending the request
17 | - **access_key** — An authorized OAuth Access Token received during the standard OAuth workflow
18 | - **upload_key** — Upload key received in the response to a [POST photos][] request
19 | - **photo_id** — The ID of the photo the file is being uploaded for
20 |
21 | [POST photos]: https://github.com/500px/api-documentation/blob/master/endpoints/photo/POST_photos.md
--------------------------------------------------------------------------------
/basics/formats_and_terms.md:
--------------------------------------------------------------------------------
1 | # Formats and Terms
2 |
3 | [500px.com][] allows discovery of the photography uploaded by users in a
4 | number of ways. An essential part of presentation is photo streams.
5 | Accessing the following streams is possible though means of the API:
6 |
7 | [500px.com]: http://500px.com/
8 |
9 | ***
10 |
11 | ## 500px Photo Terms
12 |
13 | ### Rating-based streams
14 | - [Popular][], photos with a rating over 80, sorted by rating, cached for 5 minutes
15 | - [Upcoming][], photos with a rating over 70, sorted by creation timestamp, cached for 5 minutes
16 |
17 | ### Time-based (Fresh) streams:
18 | - [Today][], photos created since midnight (EST time), cached for 60 seconds
19 | - [Yesterday][], photos created between last day’s midnight and past midnight (EST time), cached until the end of hour
20 | - [Week][], photos created in the past 7 days, excluding today, cached until the end of hour
21 |
22 | ### User-based streams:
23 | - [User’s Photos][], all active public photos of a given user
24 | - [User’s Friends’ Photos][Week], a collection of User’s Photos streams from all followings of a given user
25 |
26 | ### Special streams:
27 | - [Editors’ Choice][], photos selected by 500px.com Editors, cached indefinitely
28 |
29 | [Popular]: http://500px.com/popular
30 | [Upcoming]: http://500px.com/upcoming
31 | [Today]: http://500px.com/fresh/today
32 | [Yesterday]: http://500px.com/fresh/yesterday
33 | [Week]: http://500px.com/fresh/week
34 | [User’s Photos]: http://500px.com/iansobolev
35 | [Editors’ Choice]: http://500px.com/editors
36 |
37 | ***
38 |
39 | ## Image URLs and Image Sizes
40 |
41 | You'll find the URLs to the image(s) for a photo in the `images` field in the returned JSON for a photo. The images provided with our standard API access will be watermarked with the 500px logo and attribution. For non-watermarked images please contact sales@500px.com
42 |
43 | **Important** - You must not alter the URLs returned by the API in any way. Altered URLs will be rejected by our system when the image is loaded. Instead, please use the `image_size` parameter to request the sizes your application needs.
44 |
45 | 500px has a number of preset image sizes. Most API requests that return image URLs can be instructed to return the URLs for one or more specific sizes. To retrieve the URL for a specific image size, include that size's ID in the query string of the request, using the `image_size` parameter:
46 |
47 | ```
48 | GET /v1/photos?feature=popular&image_size=3
49 | ```
50 |
51 | If you want to request multiple sizes, you can pass an array for `image_size` as well:
52 | ```
53 | GET /v1/photos?feature=popular&image_size[]=3&image_size[]=2
54 | ```
55 | which can equivalently be specified as:
56 | ```
57 | GET /v1/photos?feature=popular&image_size=3,2
58 | ```
59 |
60 | These are the standard cropped sizes:
61 |
62 |
63 | ID
64 | Dimensions
65 |
66 | 1 70px x 70px
67 | 2 140px x 140px
68 | 3 280px x 280px
69 | 100 100px x 100px
70 | 200 200px x 200px
71 | 440 440px x 440px
72 | 600 600px x 600px
73 |
74 |
75 | These are the standard uncropped sizes:
76 |
77 |
78 | ID
79 | Dimensions
80 |
81 | 4 900px on the longest edge
82 | 5 1170px on the longest edge
83 | 6 1080px high
84 | 20 300px high
85 | 21 600px high
86 | 30 256px on the longest edge
87 | 31 450px high
88 | 1080 1080px on the longest edge
89 | 1600 1600px on the longest edge
90 | 2048 2048px on the longest edge
91 |
92 | ***
93 |
94 | ## Categories
95 | Categories of photos may be specified by their ID or string name, depending on the API method.
96 |
97 |
98 |
99 | ID
100 | Category
101 |
102 | 0 Uncategorized
103 | 10 Abstract
104 | 29 Aerial New!
105 | 11 Animals
106 | 5 Black and White
107 | 1 Celebrities
108 | 9 City and Architecture
109 | 15 Commercial
110 | 16 Concert
111 | 20 Family
112 | 14 Fashion
113 | 2 Film
114 | 24 Fine Art
115 | 23 Food
116 | 3 Journalism
117 | 8 Landscapes
118 | 12 Macro
119 | 18 Nature
120 | 30 Night New!
121 | 4 Nude
122 | 7 People
123 | 19 Performing Arts
124 | 17 Sport
125 | 6 Still Life
126 | 21 Street
127 | 26 Transportation New!
128 | 13 Travel
129 | 22 Underwater
130 | 27 Urban Exploration New!
131 | 25 Wedding New!
132 |
133 |
134 | ## License Types
135 | 500px currently supports these types of licenses, more details can be found at http://500px.com/creativecommons
136 |
137 |
138 |
139 | ID
140 | License Type
141 |
142 | 0 Standard 500px License
143 | 1 Creative Commons License Non Commercial Attribution
144 | 2 Creative Commons License Non Commercial No Derivatives
145 | 3 Creative Commons License Non Commercial Share Alike
146 | 4 Creative Commons License Attribution
147 | 5 Creative Commons License No Derivatives
148 | 6 Creative Commons License Share Alike
149 | 7 Creative Commons License Public Domain Mark 1.0
150 | 8 Creative Commons License Public Domain Dedication
151 |
152 |
153 | ## Gallery kinds
154 |
155 |
156 |
157 | ID
158 | Gallery Kinds
159 | Contents
160 |
161 | 0 General Any photo on 500px
162 | 1 Lightbox Marketplace photos
163 | 3 Portfolio* Photos displayed on the portfolio page
164 | 4 Profile* Photos uploaded by the gallery owner
165 | 5 Favorite Photos favorited by the gallery owner via the old API.
166 |
167 | * Can only contain photos uploaded by the gallery owner
168 |
169 | ## Photo object formats
170 | Categories of photos may be specified by their ID or string name, depending on the API method.
171 |
172 | ### Short format
173 | The short format of a Photo object includes the following data:
174 |
175 | - **id** — ID of the photo, integer
176 | - **name** — Title of the photo, string
177 | - **description** — Description of the photo, string
178 | - **camera** — Make and model of the camera this photo was made with, string
179 | - **lens** — This photo’s camera lens information, string
180 | - **focal\_length** — Focal length of the shot, string
181 | - **iso** — ISO value of the shot, string
182 | - **shutter\_speed** — Shutter speed value of the shot, string
183 | - **aperture** — Aperture value of the shot, string
184 | - **times\_viewed** - The number of views this photo has, integer
185 | - **rating** — Rating of the photo, decimal
186 | - **status** — Status of the photo in the system, integer. An active photo always has the status of 1.
187 | - **created\_at** — Timestamp indicating time of photo creation, timestamp
188 | - **category** — [Category][] of the photo, (short) integer
189 | - **location** — A human-readable name of the location where the photo was taken, string
190 | - **privacy** - Boolean value whether or not the community page (http://500px.com/photo/:id) of this photo is available. A value of true means the page is not available.
191 | - **latitude** — Latitude of the location where the photo was taken, decimal
192 | - **longitude** — Longitude of the location where the photo was taken, decimal
193 | - **taken\_at** — Timestamp of when the photo was taken, timestamp
194 | - **for\_sale** - Boolean value whether or not the photo is for sale
195 | - **width** - The width of the original, unresized photo, integer
196 | - **height** - The height of the origin, unresized photo, integer
197 | - **votes\_count** — Number of votes cast on this photo, integer
198 | - **comments\_count** — Number of comments this photo has, integer
199 | - **nsfw** - Boolean value whether the current photo is NSFW
200 | - **sales_count** - The number of sales this photo has
201 | - **highest_rating** - The highest rating this photo has had, decimal
202 | - **highest_rating_date** - The date the highest rating was reached on, timestamp
203 | - **license_type** - [License type][] of the photo, (short) integer
204 | - **converted** - Boolean value indicating whether or not this photo has been converted, **deprecated**.
205 | - **image\_url** — URL of the image, string, **deprecated**
206 | - **images** - Array with images URL and sizes
207 | - **user** — Author’s profile in [short format][], object
208 | - **galleries_count** - Number of galleries this photo is present in, integer
209 |
210 | [Category]: #categories
211 | [License type]: #license_types
212 |
213 | ### Full format
214 | The full format of a Photo object includes the following data:
215 |
216 | - **id** — ID of the photo, integer
217 | - **name** — Title of the photo, string
218 | - **description** — Description of the photo, string
219 | - **camera** — Make and model of the camera this photo was made with, string
220 | - **lens** — This photo’s camera lens information, string
221 | - **focal\_length** — Focal length of the shot, string
222 | - **iso** — ISO value of the shot, string
223 | - **shutter\_speed** — Shutter speed value of the shot, string
224 | - **aperture** — Aperture value of the shot, string
225 | - **times\_viewed** - The number of views this photo has, integer
226 | - **rating** — Rating of the photo, decimal
227 | - **status** — Status of the photo in the system, integer. An active photo always has the status of 1.
228 | - **created\_at** — Timestamp indicating time of photo creation, timestamp
229 | - **category** — [Category][] of the photo, (short) integer
230 | - **location** — A human-readable name of the location where the photo was taken, string
231 | - **privacy** - Boolean value whether or not the community page (http://500px.com/photo/:id) of this photo is available. A value of true means the page is not available.
232 | - **latitude** — Latitude of the location where the photo was taken, decimal
233 | - **longitude** — Longitude of the location where the photo was taken, decimal
234 | - **taken\_at** — Timestamp of when the photo was taken, timestamp
235 | - **for\_sale** - Boolean value whether or not the photo is for sale
236 | - **width** - The width of the original, unresized photo, integer
237 | - **height** - The height of the origin, unresized photo, integer
238 | - **votes\_count** — Number of votes cast on this photo, integer
239 | - **comments\_count** — Number of comments this photo has, integer
240 | - **nsfw** - Boolean value whether the current photo is NSFW
241 | - **sales_count** - The number of sales this photo has
242 | - **highest_rating** - The highest rating this photo has had, decimal
243 | - **highest_rating_date** - The date the highest rating was reached on, timestamp
244 | - **license_type** - [License type][] of the photo, (short) integer
245 | - **converted** - Boolean value indicating whether or not this photo has been converted, **deprecated**.
246 | - **image\_url** — URL of the image, string, **deprecated**
247 | - **images** - Array with images URL and sizes
248 | - **user** — Author’s profile in [short format][], object
249 | - **comments** - If requested, an array of comments.
250 | - **store_download** - Boolean value indicating whether or not the photo is for sale as a digital download.
251 | - **store_print** - Boolean value indicating whether or not the photo is for sale as a canvas print.
252 | - **editors_choice** - Boolean value indicating whether or not the photo is in Editors' Choice.
253 | - **feature** - The section of the site this photo appears under, string. Possible values are popular upcoming fresh_today fresh_yesterday fresh_week
254 | - **galleries_count** - Number of galleries this photo is present in, integer
255 |
256 | If you are authenticated when making the request. These additional fields will be returned:
257 | - **voted** — Boolean value whether the current user has voted for this photo
258 | - **purchased** — Boolean value whether the current user has bought this photo
259 |
260 | ***
261 |
262 | ## User object formats
263 |
264 | ### Short format
265 | The short format of a User object includes the following data:
266 |
267 | - **id** — ID of the user, integer
268 | - **username** — Username, string
269 | - **firstname** — First name, string
270 | - **lastname** — Last name, string
271 | - **fullname** — A combination of first and last names or a username that would naturally appear on the site, string
272 | - **city** — City as specified in user's profile, string
273 | - **country** — Country as specified in user's profile, string
274 | - **userpic\_url** — Profile picture’s URL of the user, string
275 | - **upgrade\_status** — Whether the user is a premium user, integer. Non-zero values identify premium users; a value of 2 identifies an Awesome user while a value of 1 identifies a Plus user. Other states may be added in the future, so write your parsers accordingly.
276 | - **followers_count** — User followers count
277 | - **affection** — Affection value, integer.
278 |
279 |
280 | ### Profile format
281 | The profile format of a User object includes the following data:
282 |
283 | - **id** — ID of the user, integer
284 | - **username** — Username, string
285 | - **firstname** — First name, string
286 | - **lastname** — Last name, string
287 | - **fullname** — A combination of first and last names or a username that would naturally appear on the site, string
288 | - **sex** — Sex of the user, string. Values: 1 and 2 for male and female respectively, 0 if user refused to specify their sex.
289 | - **city** — City as specified in user’s profile, string
290 | - **state** — State as specified in user’s profile, string
291 | - **country** — Country as specified in user’s profile, string
292 | - **active** — Active status of user. Values: 0 - not active, 1 - active, 2 - deleted by user, 3 - banned
293 | - **registration\_date** — Registration timestamp, timestamp
294 | - **about** — User’s about text, timestamp
295 | - **domain** - The host name of the user's portfolio, string
296 | - **locale** — User’s preferred locale, string. Current values: en, ru, de, ja, br, es
.
297 | - **upgrade\_status** — Whether the user is a premium user, integer. Non-zero values identify premium users; a value of 2 identifies an Awesome user while a value of 1 identifies a Plus user. Other states may be added in the future, so write your parsers accordingly.
298 | - **upgrade\_type** - Whether this is a paid user or trial user. Values: 0 - free user, 1 - trial user, 2 - paid user
299 | - **show\_nude** — Whether the user has content filter disabled, boolean.
300 | - **userpic\_url** — Profile picture’s URL of the user, string
301 | - **store\_on** - Whether the user has the store option enabled, boolean
302 | - **contacts** — A dictionary of user’s contacts, object. Keys should be treated as provider names, and values as user IDs with given provider.
303 | - **equipment** - A dictionary of a user's equipment. Possible keys are camera, lens, misc
. Each key will have an array of values.
304 | - **photos\_count** — Number of active photos posted by the user, integer.
305 | - **galleries\_count** — Number of galleries visible on the user's profile, integer.
306 | - **affection** — Affection value, integer.
307 | - **friends\_count** — Number of people this user follows, integer.
308 | - **followers\_count** — Number of people this user is being followed by, integer.
309 | - **admin** - Boolean value that will be 1 if the user is a 500px team member.
310 | - **avatars** - A dictionary of different avatar sizes. Keys are default, large, small, tiny
. default is up to 300x300px, large is 100x100px, small is 50x50px, tiny is 30x30px.
311 |
312 | If the user you are requesting is the currently authenticated user these additional fields will be returned:
313 | - **email** - The user's email address.
314 | - **upload\_limit** - The remaining upload limit this user has, integer
315 | - **upload\_limit\_expiry** - The date at which additional uploads will be available, if the user is currently allowed to upload then this will be now, timestamp
316 | - **upgrade\_expiry\_date** - The date at which the user's subscription will expire, timestamp
317 | - **auth** - A dictionary of a user's social network authentications. Possible keys are facebook, twitter, google_oauth2
. Each key will have a value of '1' as existing authentication or '0' as no authentication.
318 |
319 | If you are authenticated these additional fields will be returned:
320 | - **following** - A boolean value indicating whether or not you are following this user.
321 |
322 | ***
323 |
324 | ## Comment object formats
325 | The profile format of a User object includes the following data:
326 |
327 | ### Full format
328 | The full format of a Comment object includes the following data:
329 |
330 | - **id** — ID of the comment, integer
331 | - **body** — Content of the comment, string
332 | - **to_whom_user_id** — To which user the comment was made, string
333 | - **user_id** — User ID of author of the comment, string
334 | - **created_at** — Timestamp indicating time the comment was created, timestamp
335 | - **user** — Author's profile in [short format][], object
336 | - **parent_id** - The ID of the comment that was replied to. If this value is null then the comment was not a reply to another comment, integer
337 | - **flagged** - A boolean value indicating whether or not this comment was flagged for review.
338 | - **rating** - The sum of the number of votes this comment has received, integer
339 |
340 | If you are authenticated these additional attributes will be returned:
341 |
342 | - **voted** - A boolean value indicating whether or not the currently authenticated user has voted on this comment.
343 |
344 | ***
345 |
346 | ## Gallery object formats
347 |
348 | ### Short format
349 | The short format of a Gallery object includes the following data:
350 |
351 | - **id** — ID of the gallery, integer
352 | - **user_id** — ID of the user that owns the gallery, integer
353 | - **name** — Title of the gallery, string
354 | - **description** — Description of the gallery, string
355 | - **subtitle** — A short (500 char.) blurb of the gallery, string
356 | - **items_count** — Number of items in the gallery, integer
357 | - **privacy** - Boolean value whether or not the gallery is private. A value of true means the gallery is private to the user
358 | - **kind** - Indicates the **[gallery kind][]**, integer
359 | - **created\_at** — Timestamp indicating time the gallery was created, timestamp
360 | - **updated\_at** — Timestamp indicating time the gallery was updated, timestamp
361 | - **cover_photo** - Array containing a JSON hash of the cover photo's id, size, url, and nsfw flag
362 | - **custom_path** - Custom path of the gallery, string
363 | - **last_added_photo** _(optional)_ - Photo that was last added to the gallery, in **[short format](https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format)**
364 | - **user** _(optional)_ - User who owns the gallery, in **[short format][]**
365 |
366 | ### Full format
367 |
368 | The full format of a Gallery object includes the following data:
369 |
370 | - **id** — ID of the gallery, integer
371 | - **user_id** — ID of the user that owns the gallery, integer
372 | - **name** — Title of the gallery, string
373 | - **description** — Description of the gallery, string
374 | - **cover_photo** - Array containing a JSON hash of the cover photo's id, size, url, and nsfw flag
375 | - **subtitle** — A short (500 char.) blurb of the gallery, string
376 | - **items_count** — Number of items in the gallery, integer
377 | - **privacy** - Boolean value whether or not the gallery is private. A value of true means the gallery is private to the user
378 | - **kind** - Indicates the **[gallery kind][]**, integer
379 | - **created\_at** — Timestamp indicating time the gallery was created, timestamp
380 | - **updated\_at** — Timestamp indicating time the gallery was updated, timestamp
381 | - **custom_path** - A slug for the gallery url, string
382 | - **editors_choice** - Boolean value indicating whether the gallery has been featured in editor's choice
383 | - **feature** - Name of stream where gallery has been featured. Values can be either 'popular' or 'fresh'
384 | - **featured_at** - Timestamp indicating when gallery was featured
385 | - **token** - Token signature for a private gallery url. Only returned if request is made by the gallery owner
386 | - **user** _(optional)_ - User who owns the gallery, in **[short format][]**
387 |
388 | ***
389 |
390 | ## Equipment object formats
391 |
392 | ### Camera info
393 |
394 | - **id** - ID of the camera, integer
395 | - **friendly_name** - Displayable name, eg. "Canon EOS 70D"
396 | - **name** - Actual name of the camera, eg. "EOS 70D"
397 | - **verified** - Whether or not this entry is verified, true or false
398 | - **features** - Short list of features, HTML-formatted string
399 | - **slug** - The slug, eg "eos-70d",
400 | - **camera_type** - The type of camera this is, one of
401 | - dslr
402 | - film
403 | - smartphone
404 | - mirrorless
405 | - compact
406 | - medium_format
407 | - film_scanner
408 | - action_camera
409 | - drone
410 | - **brand** - A small object containing brand info, eg.
411 | ```
412 | {
413 | "id": 1,
414 | "name": "Canon",
415 | "slug": "canon"
416 | }
417 | ```
418 |
419 | ### Lens info
420 |
421 | - **id** - ID of the lens, integer
422 | - **friendly_name** - Displayable name, eg. "Canon EF-S 10-18mm f/4.5-5.6 IS STM"
423 | - **name** - Actual name of the lens, eg. "EF-S 10-18mm f/4.5-5.6 IS STM"
424 | - **slug** - The slug, eg. "ef-s-10-18mm-f-4-5-5-6-is-stm"
425 | - **features** - Short list of features, HTML-formatted string
426 | - **brand** - A small object containing brand info, eg.
427 | ```
428 | {
429 | "id": 1,
430 | "name": "Canon",
431 | "slug": "canon"
432 | }
433 | ```
434 |
435 | [Category]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#categories
436 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
437 | [gallery kind]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#gallery-kinds
438 | [License type]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#license_types
439 |
--------------------------------------------------------------------------------
/basics/terms_of_use.md:
--------------------------------------------------------------------------------
1 | # Terms of Use
2 |
3 | This agreement sets out the terms and conditions (the "API Terms of Use") pursuant to which you are licensed by 500px Inc. ("500px") to use the 500px application programming interfaces (the "500px APIs"). By accessing or using 500px APIs in any way you acknowledge and agree on your own behalf and on behalf of the company or entity you represent ("You") that you have read, understand and agree to be bound by the API Terms of Use, our 500px site terms [http://500px.com/terms](http://500px.com/terms) and our 500px site privacy policy [http://500px.com/privacy](http://500px.com/privacy), (collectively the "500px Agreement") all of which shall govern your relationship with 500px and your access to its members. 500px reserves the right to alter, delete and/or add to the 500px Agreement at its discretion. You can always find the most recent version of 500px Agreement on the following pages: [https://github.com/500px/api-documentation/blob/master/basics/terms_of_use.md](https://github.com/500px/api-documentation/blob/master/basics/terms_of_use.md).
4 |
5 | If you disagree with any part of the API Terms of Use or any other terms of the 500px Agreement, 500px does not grant you a license to use the 500px APIs and you are directed to immediately cease using the 500px APIs.
6 |
7 | ## Purpose
8 | The purpose of the 500px APIs is to permit registered users ("API Users") to develop applications that interface with the 500px site for the purpose of importing, exporting and sharing content and data with the 500px website and providing products and services to its members.
9 |
10 | ## Registration
11 | To become an API User you must register and be approved by 500px. As part of the registration and approval process you will be asked to provide your name, email and contact information, the name, email and contact information of the entity or company you represent, as well as details about the 500px API application you intend to develop and/or the products and/or services you intend to offer to 500px members using the 500px API. It is your responsibility to ensure the information provided to 500px is complete, true and accurate throughout your period as a 500px API User. If you provide any information that is untrue, inaccurate, not current or incomplete, or 500px has reasonable grounds to suspect that such information is untrue, inaccurate, not current or incomplete, 500px may terminate your 500px API license and/or the 500px Agreement.
12 |
13 | During registration, you may be asked to provide an e-mail address and to create your own password. Your e-mail address will become your user identification. Upon being accepted as an API User you will be issued one or more API keys for use with your 500px APIs. You are responsible for maintaining the confidentiality of the password and your API keys and are fully responsible for all activities that occur under your password and API keys. You agree to immediately notify 500px of any unauthorized use of your password, API keys or any other breach of security. 500px reserves the right to approve and authorize API Users at its discretion.
14 |
15 | ## Grant of 500px API License
16 | The 500px APIs are owned by 500px Inc. Upon your acceptance as an API User you are hereby granted a non-exclusive, non-sublicensable, worldwide license to use each 500px API and API Key delivered to you by 500px for the purpose authorized in your registration and acceptance as an API User, subject to the terms and conditions contained in these API Terms of Use and the other parts of your 500px Agreement. The terms and conditions of your 500px Agreement apply to all copies of the 500px APIs made by or for you, and to all updates, revisions, and substitutions, if any.
17 |
18 | Photos and images on the 500px site are owned by 500px members and not by 500px. All rights not expressly granted to you are reserved by 500px and/or its members.
19 |
20 | ## 500px API License Conditions and Restrictions
21 |
22 | ### You shall at all times:
23 | - **Provide attribution credit to the copyright owner (Photographer member of 500px) as well as a hyperlink to 500px website photo page adjacent to each use. Format for credit should read as "© Photographer Name / 500px"**
24 | - Comply with the API Terms of Use and the other terms and conditions of your 500px Agreement, [http://500px.com/terms](http://500px.com/terms) and [http://500px.com/privacy](http://500px.com/privacy).
25 | - Comply with any terms, conditions and copyright restrictions imposed on usage of photos and images by their respective member owners. 500px doesn't own the images; 500px members do. Although the 500px APIs can be used to gain access to photos, images and other information of 500px members, neither 500px’s provision of the 500px APIs to you nor your use of the 500px APIs override the owner member’s terms, conditions and copyright restrictions which may include "all rights reserved" and "private" restrictions, Creative Commons licenses and/or other terms and conditions that must be agreed upon between you and the member. You are solely responsible for making use of 500px photos, images and member other information in compliance with the member’s requirements and/or restrictions.
26 | - Remove from your application within 24 hours any 500px member’s photos, images or other information that the owner asks you to remove.
27 | - Disclose in your application through a privacy policy or statement otherwise displayed in the footer of each page, how you collect, use, store, and disclose data collected from visitors, including, where applicable, that third parties (including advertisers) may serve content and/or advertisements and collect information directly from visitors and may place or recognize cookies on visitors' browsers.
28 | - Provide 500px reasonable access to usage analytics of the application.
29 |
30 | ### You shall not:
31 | - Use 500px APIs for any application or purpose other than as approved by 500px.
32 | - Use 500px APIs for any application that replicates or attempts to replace the essential user experience of the 500px.com website or software applications built by 500px.
33 | - Attempt to cloak or conceal your identity or your application’s identity when requesting authorization to use 500px APIs.
34 | - Display more than 20 500px photos or images per page in your application or use an unreasonable amount of bandwidth.
35 | - Cache or store any photos or images obtained from 500px for more than 24 hours.
36 | - Enable downloads or storage of photos that are protected by copyright by any application.
37 | - Use 500px as a generic image hosting service for banner advertisements, graphics, etc.
38 | - Use 500px APIs in a manner that adversely impacts the stability of 500px.com servers or adversely impacts the behavior of other applications using the 500px APIs.
39 | - Sell, lease, or sublicense 500px APIs or access thereto or derive revenues from the use or provision of 500px APIs, whether for direct commercial or monetary gain or otherwise, except as set forth below.
40 |
41 | #### Without limiting the generality of the foregoing, Use 500px APIs, post, email, transmit, upload or otherwise submit any content to 500px members that:
42 | - is offensive to the 500px online community, such as content that promotes racism, bigotry, hatred or physical harm of any kind against any group or individual;
43 | could be harmful to minors;
44 | - harasses or advocates harassment of another person;
45 | - involves the transmission of "junk mail", "chain letters", or unsolicited mass mailing or "spamming";
46 | - promotes information that is false, misleading, illegal or promotes illegal activities or conduct that is abusive, threatening, obscene, defamatory or libelous;
47 | - infringes any patent, trademark, trade secret, copyright or other proprietary rights of any person including, without limitation, promoting an illegal or unauthorized copy of another person's copyrighted work, such as providing pirated computer programs or links to them, providing information to circumvent manufacture-installed copy-protect devices, or providing pirated music or links to pirated music files;
48 | - violates any law or regulation, any right of any person, including but not limited to intellectual property rights, rights of privacy, or rights of personality;
49 | - contains restricted or password only access pages, or hidden pages or images (those not linked to or from another accessible page);
50 | - displays pornography or pornographic material of any kind;
51 | - provides material that exploits people under the age of 18 in a sexual or violent manner, or solicits personal information from anyone under the age of 18;
52 | - provides instructional information about illegal activities such as making or buying illegal weapons, violating someone's privacy, or providing or creating computer viruses;
53 | - solicits 500px passwords or personal identifying information for unlawful purposes from 500px members;
54 | - engages in contests, sweepstakes, barter, advertising, and pyramid schemes, without our prior written consent;
55 | - promotes or is used in connection with spyware, adware, other malicious programs or code; and
56 | - contains or will contain any disabling mechanism or protection feature designed to prevent its use, including any clock, timer, counter, computer virus, worm, software lock, drop dead device, Trojan horse routine, trap door, time bomb or any other codes, designs, routines or instructions that may be used to access, modify, replicate, distort, delete damage or disable any content, any services or any 500px application, or web site or any operating system software or hardware on which such content, service application or website is operated or displayed.
57 |
58 |
59 | ## Termination
60 | A separate license to use a 500px API is granted each time the related API Key is made available to you. You may terminate a 500px API license by providing notice to 500px and discontinuing use of the related 500px API.
61 |
62 | 500px may terminate a 500px API license or the 500px Agreement, at any time for any reason. Your rights to use the 500px APIs terminate automatically if (i) you violate any terms of your 500px Agreement, (ii) 500px publicly posts a written notice of termination on 500px.com, (iii) 500px sends a written notice of termination to you, or (iv) 500px disables the API Key and access to the 500px APIs.
63 |
64 | ## Trademark License
65 | "500px", the 500px logo and such other trademarks and logos that are from time to time used by 500px are proprietary trademarks of 500px Inc (the "500px Trademarks"). API Users are hereby granted a non-exclusive, non-sublicensable, worldwide license to use 500px Trademarks as follows. All other uses are strictly prohibited.
66 |
67 | You shall place the following statement prominently on your 500px API application: "This product uses the 500px API but is not endorsed or certified by 500px."
68 | You may use 500px Trademarks with the prior written consent of 500px. Any approved use of 500px Trademarks will require that the 500px Trademark be less prominent than the logo or mark that primarily describes the application and be accompanied by the following statement: "This [application/website] uses the 500px(tm) API and is not endorsed or certified by 500px or 500px Inc. All 500px Trademarks displayed on this [application/website] are property of 500px Inc."
69 | You shall not use "500px" in your product name, domain name, or images.
70 | You shall not use a 500px Trademark in any manner that implies endorsement of your company, its products and/or services or the 500px API application by 500px.
71 |
72 | ## Ownership
73 | The 500px APIs are the sole and exclusive property of 500px and its licensors and all copyright, patent, trademarks and other intellectual property rights therein are owned or licensed by and are proprietary to 500px and its licensors. 500px’s rights apply to the 500px APIs and all output and executables of the 500px APIs, excluding any software components developed by you which do not themselves incorporate the 500px APIs or any output or executables of the 500px APIs. You agree to abide by all applicable proprietary rights laws and other laws, as well as any additional copyright notices or restrictions contained in these terms.
74 |
75 | ## Support
76 | 500px may elect to provide you with support or modifications for the 500px APIs (collectively, "Support"), in its sole discretion, and may terminate such Support at any time without notice to you. 500px may change, suspend, or discontinue any aspect of the 500px APIs at any time, including the availability of any 500px APIs. 500px may also impose limits on certain features and services or restrict your access to parts or all of the 500px APIs or the 500px web site without notice or liability.
77 |
78 | ## Fees and Payments
79 | 500px is committed to free and open access to our APIs. However, providing the APIs does have real costs for 500px. For uses of 500px APIs over a reasonable rate or for certain types of commercial applications, 500px reserves the right to charge fees for future use of or access to the 500px APIs or to terminate your 500px API license.
80 |
81 | ## Disclaimer of Warranty
82 | SOME OF THE 500PX API(S) MAY BE EXPERIMENTAL AND NOT TESTED IN ANY MANNER. 500PX DOES NOT REPRESENT OR WARRANT THAT ANY 500PX API(S) ARE FREE OF INACCURACIES, ERRORS, BUGS, OR INTERRUPTIONS, OR ARE RELIABLE, ACCURATE, COMPLETE, OR OTHERWISE VALID.
83 |
84 | THE 500PX API(S) ARE PROVIDED "AS IS" WITH NO WARRANTY, EXPRESS OR IMPLIED, OF ANY KIND AND 500PX EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AVAILABILITY, SECURITY, TITLE AND/OR NON-INFRINGEMENT. 500PX MAKES NO REPRESENTATION OR WARRANTY REGARDING, IS NOT RESPONSIBLE FOR, AND DISCLAIMS ALL LIABILITY FOR, THE CONTINUED AVAILABILITY, RELIABILITY, ACCURACY, RESULTS OR PERFORMANCE OF 500PX.COM OR ANY MATERIAL ON 500PX.COM, THE PERFORMANCE OF THE INTERNET, THE DOWNLOADING COMPATIBILITY OF ANY MATERIALS OR SOFTWARE WITH YOUR COMPUTER SYSTEM, THE EXISTENCE OF ANY VIRUS, WORM, MALICIOUS CODE OR OTHER DISABLING DEVICE FROM ANY SOURCE, THE UNAUTHORIZED ACCESS TO OR USE OF YOUR INFORMATION BY A PERSON, CORPORATION OR ENTITY OTHER THAN 500PX, ANY TECHNICAL FAILURES (INCLUDING HARDWARE OR SOFTWARE FAILURES), INCOMPLETE, SCRAMBLED, OR DELAYED COMPUTER TRANSMISSIONS, AND/OR TECHNICAL INACCURACIES, OR LOSS OR USE OF DATA, AS WELL AS UNAUTHORIZED ACCESS OF USER TRANSMISSIONS BY THIRD PARTIES.
85 |
86 | YOUR USE OF 500PX API(S) IS AT YOUR OWN DISCRETION AND RISK, AND YOU WILL BE SOLELY RESPONSIBLE FOR ANY DAMAGE THAT RESULTS FROM THE USE OF ANY 500PX API(S) INCLUDING, BUT NOT LIMITED TO, ANY DAMAGE TO YOUR COMPUTER SYSTEM OR LOSS OF DATA.
87 |
88 | ## Limitation of Liability
89 | 500PX ITS DIRECTORS, OFFICERS, SHAREHOLDERS, EMPLOYEES, CONSULTANTS, AND AGENTS SHALL NOT, UNDER ANY CIRCUMSTANCES, BE LIABLE TO YOU FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH USE OF THE 500PX API(S), WHETHER BASED ON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE, PRODUCT LIABILITY OR OTHERWISE), OR ANY OTHER PECUNIARY LOSS, WHETHER OR NOT NOTICE HAS BEEN PROVIDED TO ANY SUCH PERSON OR ENTITY OF THE POSSIBILITY OF SUCH DAMAGES. UNDER NO CIRCUMSTANCES SHALL 500PX ITS DIRECTORS, OFFICERS, SHAREHOLDERS, EMPLOYEES, CONSULTANTS AND AGENTS BE LIABLE TO YOU FOR ANY AMOUNT IN EXCESS OF $100.
90 |
91 | YOU EXPRESSLY ACKNOWLEDGE THAT 500PX HAS ENTERED INTO AND GRANTED YOU THE LICENSES CONTAINED IN THE API TERMS OF USE IN RELIANCE UPON THE LIMITATIONS AND EXCLUSIONS OF LIABILITY AND THE DISCLAIMERS SET FORTH HEREIN, AND THAT THEY FORM AN ESSENTIAL BASIS OF THE BARGAIN BETWEEN YOU AND 500PX. YOU EXPRESSLY AGREE THE LIMITATIONS AND EXCLUSIONS OF LIABILITY AND THE DISCLAIMERS SET FORTH IN THE API TERMS OF USE SHALL SURVIVE, AND CONTINUE TO APPLY IN THE CASE OF, FUNDAMENTAL BREACH OR BREACHES, THE FAILURE OF ESSENTIAL PURPOSE OF CONTRACT, THE FAILURE OF ANY EXCLUSIVE REMEDY OR TERMINATION OF YOUR ACCESS TO AND USE OF 500PX.COM AND ITS CONTENT.
92 |
93 | SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF CERTAIN WARRANTIES OR THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES. ACCORDINGLY, SOME OF THE ABOVE LIMITATIONS OF SECTIONS 10 AND 11 MAY NOT APPLY TO YOU.
94 |
95 | ## Release and Waiver of Liability
96 | To the maximum extent permitted by applicable law, you hereby release and waive all claims against 500px its subsidiaries, affiliates and their respective directors, officers, employees, consultants, agents co-branders and other partners from any and all liability for claims, damages (actual and/or consequential), costs and expenses (including litigation costs and attorneys’ fees) of every kind and nature, arising from or in any way related to your use of 500px APIs. You expressly waive and relinquish any and all rights and benefits which you may have under any provincial, state or federal statute or common law principle of similar effect, to the fullest extent permitted by law.
97 |
98 | ## Indemnification
99 | To the maximum extent permitted by applicable law, you agree to defend, indemnify and hold harmless 500px its subsidiaries, affiliates and their respective directors, officers, employees, consultants, agents co-branders or other partners from and against any third party claim arising from or in any way related to your use of 500px APIs, including any liability or expense arising from all claims, losses, damages (actual and/or consequential), suits, judgments, litigation costs and attorneys' fees, of every kind and nature. 500px shall use good faith efforts to provide you with written notice of such claim, suit or action.
100 |
101 | ## Arbitration
102 | Any controversy, claim or dispute arising out of or relating to the 500px Agreement including without limitation, the performance, breach, enforcement, existence or validity of the 500px Agreement which cannot be resolved by 500px and you (a "Claim"), shall be referred to and finally settled (to the exclusion of the courts) by private and confidential binding arbitration before a single arbitrator in Toronto, Ontario, Canada in English pursuant to the Arbitration Act 1991, (Ontario), as amended, replaced or re-enacted from time to time. The arbitrator shall be a person who is trained in law and who has experience in the information technology field in Canada and is independent of you and 500px. Any such Claim shall be arbitrated on an individual basis, and shall not be consolidated in any arbitration with any claim, controversy or dispute of any other person, corporation or entity. You agree to waive any right you may have to commence or participate in any class action against 500px related to any Claim and you agree to opt out of any class proceedings against 500px. However, 500px reserves the right to refer any Claim in respect of intellectual property to the Federal Court of Canada.
103 |
104 | ## General Terms
105 | Notwithstanding any provision hereof, for all purposes of the 500px Agreement, you and 500px shall be and act independently and not as partner, joint venturer, agent, employee or employer of the other. You shall not have any authority to assume or create any obligation for or on behalf of 500px, express or implied, and you shall not attempt to bind 500px to any contract.
106 |
107 | The 500px Agreement constitutes the entire agreement between 500px and you about your use of 500px APIs and, except as specifically set forth in the 500px Agreement, supersede any prior agreements between you and 500px relating to the 500px APIs your access to and use of 500px.com and its content. 500px may assign the 500px Agreement, in whole or in part, at any time. 500px’s failure to insist upon or enforce strict performance of any right or provision of the 500px Agreement shall not constitute or be construed as a waiver of any right or provision. If any of the provisions (or parts thereof) contained in the 500px Agreement, as amended from time to time, are determined to be void, invalid or otherwise unenforceable by a court of competent jurisdiction, such determination shall not affect the remaining provisions (or parts thereof) contained in the 500px Agreement which shall remain in full force and effect and shall be construed as if the invalid provision had been omitted. The section headings and subheadings contained in the 500px Agreement are included for convenience only, and shall not limit or otherwise affect the terms of the 500px Agreement. Any construction or interpretation to be made of the 500px Agreement shall not be construed against the drafter. 500px and you have required that the Terms of Use and all documents relating thereto be drawn up in English. Les parties ont demandé que cette convention ainsi que tous les documents que s’y rattachent soient rédigés en anglais (Version française). In the event of a conflict between the English and French version of these terms, the English version shall prevail.
108 |
109 | Published on August 16, 2011. Modified on May 29, 2012.
110 |
--------------------------------------------------------------------------------
/basics/upload.md:
--------------------------------------------------------------------------------
1 | # Uploading a photo
2 | To upload a photo, you need to do 2 requests:
3 | 1. `POST /photos`
4 | 1. `POST url-obtained-from-first-request`
5 |
6 | First, send a `POST` request to `/photos` ([see documentation](https://github.com/500px/api-documentation/blob/master/endpoints/photo/POST_photos.md)) with the photo details like title, description and so on. You may also want to set the `privacy` parameter to `1` if you wish to do a private upload or `0` for public upload. Finally, you can pass `auto_activate` parameter set to `true` to have to photo marked active as soon as it is uploaded.
7 |
8 | This request will return a JSON with the upload `url` and a data structure that you need to use for the second request. Here's an example of [such data structure taken from the `POST /photos`](https://github.com/500px/api-documentation/blob/master/endpoints/photo/POST_photos.md#example)
9 | ``` json
10 | "presigned_post": {
11 | "url": "https://s3.amazonaws.com/photos.500px.net",
12 | "fields": {
13 | ...
14 | }
15 | }
16 | ```
17 |
18 | The second request is uploading the file itself. You do that by sending a POST request to the `url` that you obtained from the previous request. The body of the request must be in the multipart form-data format and must have all the properties from the `fields` structure that was returned in the first request. NOTE: the order matters, you need to supply the `fields` in the exact same order you received it. The last parameter is the file to be uploaded in the `file` field.
19 |
20 | Here's an example request, the fields are `form-data`:
21 | ```
22 | POST https://s3.amazonaws.com/photos.500px.net
23 |
24 | name="key" 238921583/cb47e80843a0eaaaaac2fc242c9cd6bcecd6f36/0.jpg
25 | name="x-amz-meta-user_id" 16972409
26 | name="x-amz-meta-client_application_id" 0
27 | name="x-amz-meta-user_agent" Chrome/62.0.3202.94 Safari/537.36
28 | name="x-amz-meta-user_ip" 206.223.171.146
29 | name="policy" eyJleHBpcmF0aW9uIjoiMjAxN...
30 | name="x-amz-credential" ASDASDASDASDASD/20171212/us-east-1/s3/aws1_request
31 | name="x-amz-algorithm" AWS4-HMAC-SHA256
32 | name="x-amz-date" 20171212T195326Z
33 | name="x-amz-signature" 47aa1...
34 | name="file"; filename="IMG_20171028_175620-01.jpeg"
35 | Content-Type: image/jpeg
36 |
37 | ...the file contents...
38 | ```
39 |
40 | ***
41 |
42 | ## Return format
43 | `POST /photos` will return HTTP status 200 on success. Proceed with the second request only when you get back the 200 status.
44 |
45 | `POST url-from-first-request` will return HTTP status 204 upon successful upload.
46 |
--------------------------------------------------------------------------------
/endpoints/collections/DELETE_collections_id.md:
--------------------------------------------------------------------------------
1 | ### DEPRECATED
2 |
3 | Please use the corresponding **[galleries endpoint][]**
4 |
5 | ***
6 |
7 | # Collections Resources
8 |
9 | DELETE collections/:collection_id
10 |
11 | ## Description
12 | Deletes collection.
13 |
14 | ***
15 |
16 | ## Requires authentication
17 | **[OAuth][]**
18 |
19 | ***
20 |
21 | ## Return format
22 | **TODO**
23 |
24 | ***
25 |
26 | ## Errors
27 | None
28 |
29 | ***
30 |
31 | ## Example
32 | **Request**
33 |
34 | GET v1/collections
35 |
36 | **Return**
37 |
38 | **TODO**
39 |
40 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
41 | [Feature]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#500px-photo-terms
42 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
43 | [galleries endpoint]: https://github.com/500px/api-documentation/blob/master/endpoints/galleries/DELETE_galleries_id.md
44 |
--------------------------------------------------------------------------------
/endpoints/collections/GET_collections.md:
--------------------------------------------------------------------------------
1 | ### DEPRECATED
2 |
3 | Please use the corresponding **[galleries endpoint][]**
4 |
5 | ***
6 |
7 | # Collections Resources
8 |
9 | GET collections
10 |
11 | ## Description
12 | Returns a listing of all User's collections and sets.
13 |
14 | ***
15 |
16 | ## Requires authentication
17 | **[OAuth][]**
18 |
19 | ***
20 |
21 | ## Parameters
22 |
23 | - **photos_per_collection_limit** — The number of photos included in each collection. Can not be over 200, default 200.
24 |
25 | ***
26 |
27 | ## Return format
28 | A JSON object with **collections** — An indexed array of Collection objects in **[short format][]**.:
29 |
30 | ***
31 |
32 | ## Errors
33 | None
34 |
35 | ***
36 |
37 | ## Example
38 | **Request**
39 |
40 | GET v1/collections
41 |
42 | **Return**
43 | ``` json
44 | {
45 | "collections": [
46 | {
47 | "id": 289621,
48 | "title": "Film set",
49 | "position": 0,
50 | "created_at": "2012-05-24T10:13:34-04:00",
51 | "path": "film_set",
52 | "photos": [
53 | {
54 | "id": 7905188,
55 | "name": "St Lawrence Market Toronto",
56 | "rating": 0,
57 | "created_at": "2012-05-24T11:22:46-04:00",
58 | "category": 3,
59 | "image_url": "http://pcdn.500px.net/7905188/9e1fcf034f7492c92d0f98e504d80c0b80e15990/4.jpg",
60 | "votes_count": 0,
61 | "position": 1
62 | },
63 | {
64 | "id": 7905189,
65 | "name": "Distillery district Toronto",
66 | "rating": 0,
67 | "created_at": "2012-05-24T11:22:49-04:00",
68 | "category": 3,
69 | "image_url": "http://pcdn.500px.net/7905189/cc0ff39d30614fea56f2583ec796460d6a05d69c/4.jpg",
70 | "votes_count": 0,
71 | "position": 2
72 | }
73 | ]
74 | },
75 | {
76 | "id": 298603,
77 | "title": "Bikes set",
78 | "position": 1,
79 | "created_at": "2012-06-07T13:15:26-04:00",
80 | "path": "bikes_set",
81 | "photos": [
82 | {
83 | "id": 7651996,
84 | "name": "bike",
85 | "rating": 48.7,
86 | "created_at": "2012-05-16T11:47:12-04:00",
87 | "category": 26,
88 | "image_url": "http://pcdn.500px.net/7651996/bfc9a0ae7cfaed28ebc947c2d4cd79e60a04934d/4.jpg",
89 | "votes_count": 2,
90 | "position": 1
91 | }
92 | ]
93 | }
94 | ]
95 | }
96 | ```
97 |
98 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
99 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
100 | [galleries endpoint]: https://github.com/500px/api-documentation/blob/master/endpoints/galleries/GET_galleries.md
101 |
--------------------------------------------------------------------------------
/endpoints/collections/GET_collections_id.md:
--------------------------------------------------------------------------------
1 | ### DEPRECATED
2 |
3 | Please use the corresponding **[galleries endpoint][]**
4 |
5 | ***
6 |
7 | # Collections Resources
8 |
9 | GET collections/:id
10 |
11 | ## Description
12 | Returns a collection.
13 |
14 | ***
15 |
16 | ## Requires authentication
17 | **[OAuth][]**
18 |
19 | ***
20 |
21 | ## Parameters
22 |
23 | - **image_size** - Numerical size of the image to link to, 1 being the smallest and 4 being the largest. Multiple image sizes may be specified as ```image_size[]=2&image_size[]=4```.
24 |
25 | ***
26 |
27 | ## Return format
28 | A JSON object with **collections** — An indexed array of Collection objects in **[short format][]**.:
29 |
30 | ***
31 |
32 | ## Errors
33 | None
34 |
35 | ***
36 |
37 | ## Example
38 | **Request**
39 |
40 | GET v1/collections/52&image_size=3
41 |
42 | **Return**
43 | ``` json
44 | {
45 | "id": 52,
46 | "title": "models",
47 | "position": 0,
48 | "created_at": "2012-06-04T13:55:08-04:00",
49 | "path": "models",
50 | "kind": "portfolio",
51 | "photos": [
52 | {
53 | "id": 500,
54 | "name": "Maria | portrait 1",
55 | "rating": 0,
56 | "created_at": "2012-06-04T10:18:18-04:00",
57 | "category": 0,
58 | "image_url": "http://dpcdn.500px.net/500/1e38495dab54fbe8bcc3b7a3679ee8f52e34cc8f/4.jpg",
59 | "images":[
60 | {"size":3,
61 | "url":"http://dpcdn.500px.org/500/9661dc2247a00f115456a3af08b804cb61d493cd/3.jpg?v=0",
62 | "https_url":"https://gp1.wac.edgecastcdn.net/806614/photos/photos.500px.net/500/9661dc2247a00f115456a3af08b804cb61d493cd/3.jpg?v=0"}],
63 | "votes_count": 0,
64 | "position": 999
65 | },
66 | {
67 | "id": 499,
68 | "name": "Maria | portrait 2",
69 | "rating": 0,
70 | "created_at": "2012-06-04T10:18:12-04:00",
71 | "category": 0,
72 | "image_url": "http://dpcdn.500px.net/499/3a323000e7b9ca7676b01de3916543c479e636f0/4.jpg",
73 | "images":[
74 | {"size":3,
75 | "url":"http://ppcdn.500px.org/499/573b00d542f811de627c4cbb0fb1c1c09b76e729/3.jpg?v=0",
76 | "https_url":"https://gp1.wac.edgecastcdn.net/806614/photos/photos.500px.net/499/573b00d542f811de627c4cbb0fb1c1c09b76e729/3.jpg?v=0"}]
77 | "votes_count": 0,
78 | "position": 999
79 | }
80 | ]
81 | }
82 | ```
83 |
84 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
85 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
86 | [galleries endpoint]: https://github.com/500px/api-documentation/blob/master/endpoints/galleries/GET_galleries_id.md
87 |
--------------------------------------------------------------------------------
/endpoints/collections/POST_collections.md:
--------------------------------------------------------------------------------
1 | ### DEPRECATED
2 |
3 | Please use the corresponding **[galleries endpoint][]**
4 |
5 | ***
6 |
7 | # Collections Resources
8 |
9 | POST collections
10 |
11 | ## Description
12 | Creates new a collection.
13 |
14 | ***
15 |
16 | ## Requires authentication
17 | **[OAuth][]**
18 |
19 | ## Parameters
20 |
21 | Essential information:
22 |
23 | - **title** _(required)_ — Title for the collection.
24 | - **path** _(required)_ — Path where the collection will be accessible at 500px.com/user/sets/:path.
25 | - **kind** — Kind of the Collection to be created Recognized values: 1 - Portfolio Set (default), 2 - Profile Set.
26 | - **photo_ids** — Comma separated list of Photo ID values to post with the blog.
27 |
28 | Optional information:
29 |
30 | - **position** — Position of the collection in the list of collections.
31 |
32 | ***
33 |
34 | ## Return format
35 | A JSON object with **collections** — An indexed array of Collection objects in **[short format][]**.:
36 |
37 | ***
38 |
39 | ## Errors
40 |
41 | - **path** — path of the collection has already been taken.
42 | - **403 Forbidden** — You have to upgrade to create portfolios and sets.
43 |
44 | ***
45 |
46 | ## Example
47 | **Request**
48 |
49 | POST v1/collections?title=bikes&path=bikes
50 |
51 | **Return**
52 | ``` json
53 | {
54 | "id": 298782,
55 | "title": "bikes",
56 | "position": 10,
57 | "created_at": "2012-06-07T17:36:17-04:00",
58 | "path": "bikes",
59 | "photos": []
60 | }
61 | ```
62 |
63 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
64 | [Feature]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#500px-photo-terms
65 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
66 | [galleries endpoint]: https://github.com/500px/api-documentation/blob/master/endpoints/galleries/POST_galleries.md
67 |
--------------------------------------------------------------------------------
/endpoints/collections/PUT_collections_id.md:
--------------------------------------------------------------------------------
1 | ### DEPRECATED
2 |
3 | Please use the corresponding **[galleries endpoint][]**
4 |
5 | ***
6 |
7 | # Collections Resources
8 |
9 | PUT collections/:id
10 |
11 | ## Description
12 | Updates collection.
13 |
14 | ***
15 |
16 | ## Requires authentication
17 | **[OAuth][]**
18 |
19 | ## Parameters
20 |
21 | Essential information:
22 |
23 | - **id** _(required)_ — Collection ID.
24 | - **title** — Title for the collection.
25 | - **path** — Path where the collection will be accessible at 500px.com/user/sets/:path.
26 | - **photo_ids** — Comma separated list of Photo ID values that are in this collection.
27 | - **kind** — Change kind of the Collection. Recognized values: 1 - Portfolio Set, 2 - Profile Set.
28 |
29 | Optional information:
30 |
31 | - **position** — Position of the collection in the list of collections.
32 |
33 | ***
34 |
35 | ## Return format
36 | A JSON object with **collections** — An indexed array of Collection objects in **[short format][]**.:
37 |
38 | ***
39 |
40 | ## Errors
41 | None
42 |
43 | ***
44 |
45 | ## Example
46 | **Request**
47 |
48 | PUT v1/collections/298603?title=Bikes&photo_ids=7651996
49 |
50 | **Return**
51 | ``` json
52 | {
53 | id: 298603,
54 | title: "Bikes",
55 | position: 0,
56 | created_at: "2012-06-07T13:15:26-04:00",
57 | path: "bikes_set",
58 | photos: [
59 | {
60 | id: 7651996,
61 | name: "bike",
62 | rating: 48.7,
63 | created_at: "2012-05-16T11:47:12-04:00",
64 | category: 26,
65 | image_url: "http://pcdn.500px.net/7651996/bfc9a0ae7cfaed28ebc947c2d4cd79e60a04934d/4.jpg",
66 | votes_count: 2,
67 | position: 999
68 | }
69 | ]
70 | }
71 | ```
72 |
73 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
74 | [Feature]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#500px-photo-terms
75 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
76 | [galleries endpoint]: https://github.com/500px/api-documentation/blob/master/endpoints/galleries/PUT_galleries_id.md
77 |
--------------------------------------------------------------------------------
/endpoints/comments/POST_comments_id_comments.md:
--------------------------------------------------------------------------------
1 | # Comment Resources
2 |
3 | POST comments/:id/comments
4 |
5 | ## Description
6 | Creates a reply to an existing comment. Comments can only be nested one level deep, you cannot reply to a reply of a comment. If a comment has a non-null parent_id value then it cannot be replied to.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | **[OAuth][]**
12 |
13 | ***
14 |
15 | ## Parameters
16 | - **body** _(required)_ — Content of the comment.
17 |
18 | ***
19 |
20 | ## Return format
21 | A JSON object with key "status" and value of 200, a key "message" with value of "Successfully added a comment.", and a key of "comment" including the comment model of the comment that was created.
22 |
23 | ***
24 |
25 | ## Errors
26 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
27 |
28 | - **400 Bad Request** — The body of the comment was not specified.
29 | - **404 Not Found** — The specified comment was not found.
30 |
31 | ***
32 |
33 | ## Example
34 | **Request**
35 |
36 | POST v1/comments/73249443/comments
37 |
38 | **Body**
39 |
40 | body=Nice+color+and+composition.
41 |
42 | **Result**
43 | ``` json
44 | {
45 | "status" : 200,
46 | "message" : "Successfully added a comment.",
47 | "error" : "None"
48 | "comment": {
49 | "id": 83858343,
50 | "user_id": 198867,
51 | "to_whom_user_id": 347823,
52 | "body": "Nice color and composition.",
53 | "created_at": "2013-02-25T17:35:26-05:00",
54 | "parent_id": 73249443,
55 | "flagged": false,
56 | "rating": 0,
57 | "voted": false,
58 | "user": {
59 | "id": 198867,
60 | "username": "tye",
61 | "firstname": "Tye",
62 | "lastname": "Shavik",
63 | "city": "Toronto",
64 | "country": "Canada",
65 | "fullname": "Tye Shavik",
66 | "userpic_url": "http://acdn.500px.net/198867/7f5f29fd33e093062a30e2bf3a9e605c446ba960/1.jpg?29",
67 | "upgrade_status": 2,
68 | "followers_count": 36,
69 | "affection": 103,
70 | "admin": 1
71 | }
72 | }
73 | }
74 | ```
75 |
76 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
--------------------------------------------------------------------------------
/endpoints/galleries/DELETE_galleries_id.md:
--------------------------------------------------------------------------------
1 | # Galleries Resources
2 |
3 | DELETE users/:user_id/galleries/:id
4 |
5 | ## Description
6 |
7 | Deletes the gallery.
8 |
9 | ***
10 |
11 | ## Requires authentication
12 | **[OAuth][]**
13 |
14 | ***
15 |
16 | ## Parameters
17 |
18 | - **id** _(required)_ — The ID of the gallery to delete.
19 |
20 | ***
21 |
22 | ## Return format
23 | A JSON object containing keys: **status**, **message** and **error** (if an error occurred).
24 |
25 | ***
26 |
27 | ## Errors
28 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
29 |
30 | - **403 Forbidden** — You do not own the gallery you are trying to delete.
31 | - **404 Not Found** — The gallery you are trying to delete does not exist, or is private (and you are not its owner)
32 |
33 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
34 |
--------------------------------------------------------------------------------
/endpoints/galleries/GET_galleries.md:
--------------------------------------------------------------------------------
1 | # Galleries Resources
2 |
3 | GET users/:user_id/galleries
4 |
5 | ## Description
6 |
7 | Returns a listing of twenty (up to one hundred) galleries for the given user.
8 |
9 | ***
10 |
11 | ## Requires authentication
12 | * A valid Consumer Key must be provided in the **consumer_key** parameter.
13 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
14 |
15 | ***
16 |
17 | ## Parameters
18 | - **sort** — Sort galleries in the specified order.
19 | ###### Recognized values:
20 | - 'created_at' — Sort by time of creation
21 | - 'updated_at' — Sort by time of last change (photo added or removed). This is the default.
22 | - 'last_added_to_at' — Sort by time last photo was added to the gallery.
23 | - 'rating' — Sort by gallery rating
24 | - 'position' — Sort by gallery position (as defined by the user)
25 |
26 | - **cover_size** — The cover photo size to be returned, if `include_cover` is set. Defaults to 4.
27 | - **include_cover** — If 1, the user's cover is included.
28 | - **sort_direction** — Control the order of the sorting. You can provide a **sort_direction** without providing a **sort**, in which case the default sort is used.
29 | ###### Recognized values:
30 | - 'asc' — Sort in ascending order (lowest or least-recent first). This is the default.
31 | - 'desc' — Sort in descending order (highest or most-recent first).
32 |
33 | - **privacy** — The privacy level of the galleries to return.
34 | ###### Recognized values:
35 | - 'private' — Only include the user's private galleries in the response. Only available for the current user.
36 | - 'public' — Only include the user's public galleries in the response. This is the default.
37 | - 'both' - Include both the public and private galleries in the response. Only available for the current user.
38 |
39 | - **kinds** — A comma-separated list of **[gallery kinds][]**. Default is to return all galleries.
40 | - **page** — Return a specific page in the photo stream. Page numbering is 1-based.
41 | - **rpp** — The number of results to return. Cannot be over 100, default 20.
42 |
43 | ***
44 |
45 | ## Return format
46 | A JSON object with the following keys and values:
47 |
48 | - **filters** — Additional filters that were used:
49 | - 'privacy' — The value of the privacy filter used;
50 | - 'kinds' — The value of the **[gallery kinds][]** requested;
51 | - **current_page** — Number of the page that is returned.
52 | - **total_pages** — Total number of pages in this feature's stream.
53 | - **total_items** — Total number of items in this feature's stream.
54 | - **galleries** — An array of Gallery objects in **[short format][]**.
55 |
56 | ***
57 |
58 | ## Errors
59 | - **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.
60 |
61 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
62 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-3
63 | [gallery kinds]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#gallery-kinds
64 |
--------------------------------------------------------------------------------
/endpoints/galleries/GET_galleries_id.md:
--------------------------------------------------------------------------------
1 | # Galleries Resources
2 |
3 | GET users/:user_id/galleries/:id
4 |
5 | ## Description
6 |
7 | Returns the details of the requested gallery
8 |
9 | `:id` can be one of the following:
10 |
11 | * gallery id
12 | * gallery path
13 | * gallery token
14 |
15 | Gallery id and path can be used to access any publicly-shared galleries, while
16 | knowing a gallery's secret token allows access to the corresponding private galler (regardless of ownership).
17 | The gallery id can be used to access any gallery owned by the current user (public or private).
18 |
19 | ***
20 |
21 | ## Requires authentication
22 | * A valid Consumer Key must be provided in **consumer_key** parameter.
23 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
24 |
25 | ***
26 |
27 | ## Parameters
28 | - **cover_size** — The cover photo size to be returned. Defaults to 4.
29 |
30 | ***
31 |
32 | ## Return format
33 | The requested Gallery object in **[full format][]**.
34 |
35 | ***
36 |
37 | ## Errors
38 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
39 |
40 | - **404 Not Found** — The gallery you are requesting does not exist, or is private (and you are not its owner)
41 |
42 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
43 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format-3
44 |
--------------------------------------------------------------------------------
/endpoints/galleries/GET_galleries_id_items.md:
--------------------------------------------------------------------------------
1 | # Galleries Resources
2 |
3 | GET users/:user_id/galleries/:id/items
4 |
5 | ## Description
6 |
7 | Returns a listing of twenty (up to one hundred) photos in the given gallery.
8 |
9 | ***
10 |
11 | ## Requires authentication
12 | * A valid Consumer Key must be provided in **consumer_key** parameter.
13 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
14 |
15 | ***
16 |
17 | ## Parameters
18 | - **only** — String name of the **[category][]** to return photos from. **Note:** Case sensitive, separate multiple values with a comma.
19 | - **exclude** — String name of the **[category][]** to exclude photos by. **Note:** Case sensitive, separate multiple values with a comma.
20 | - **sort** — Sort photos in the specified order.
21 | ###### Recognized values:
22 | - 'created_at' — Sort by time of upload.
23 | - 'rating' — Sort by rating.
24 | - 'highest_rating' — Sort by the highest rating the photo reached.
25 | - 'times_viewed' — Sort by view count.
26 | - 'votes_count' — Sort by number of likes.
27 | - 'comments_count' — Sort by number of comments.
28 | - 'taken_at' — Sort by the original date of the image extracted from metadata (might not be available for all images).
29 | - 'position' — Sort by the user's manually defined order. This is the default.
30 |
31 | - **sort_direction** — Control the order of the sorting. You can provide a **sort_direction** without providing a **sort**, in which case default sort will be used.
32 | ###### Recognized values:
33 | - 'asc' — Sort in ascending order (lowest or least-recent first). This is the default.
34 | - 'desc' — Sort in descending order (highest or most-recent first).
35 |
36 | - **page** — Return a specific page in the photo stream. Page numbering is 1-based.
37 | - **rpp** — The number of results to return. Cannot be over 100, default 20.
38 | - **image_size** — The photo size to be returned. It has to be an integer: 1 to 4. Also an array is accepted:
39 | ###### Example:
40 | - '&image_size=3'
41 | - '&image_size[]=3&image_size[]=4'
42 |
43 | - **include_store** — If set to 1, returns market infomation about the photo.
44 | ###### Returned values:
45 | - 'store_download' — Boolean value if the picture is avaliable for HD Download purchase.
46 | - 'store_print' — Boolean value if the picture is avaliable for Canvas print purchase.
47 | - 'store_license' — Boolean value if the picture is avaliable for Prime purchase.
48 | - 'store_width' — Integer value indicating the store size of the photo.
49 | - 'store_height' — Integer value indicating the store size of the photo.
50 |
51 | - **include_states** — If set to 1, returns state of the photo for the currently logged in user and authenticated request.
52 | ###### Returned values:
53 | - 'liked' — Boolean value whether the current user has liked this photo
54 | - 'purchased' — Boolean value whether the current user has bought this photo
55 |
56 | - **include_tags** (or **tags**) — If set to 1, returns an array of tags for the photo.
57 |
58 | - **include_missing** — If set to 1, returns ids of photos that have been deleted, made private or the owner of the photo is deactivated.
59 |
60 | - **include_geo** — If set to 1, returns location information about the photo.
61 |
62 | - **include_licensing** — If set to 1, returns licensing information for the photo.
63 |
64 | ***
65 |
66 | ## Return format
67 | A JSON object with the following keys and values:
68 |
69 | - **filters** — Additional filters that were used:
70 | - 'category' — The ID of the **[category][]** that photos were filtered by;
71 | - 'exclude' - The ID of the **[category][]** that photos were excluded;
72 | - **current_page** — Number of the page that is returned.
73 | - **total_pages** — Total number of pages in this feature's stream.
74 | - **total_items** — Total number of items in this feature's stream.
75 | - **photos** — An array of Photo objects in **[short format][]**.
76 |
77 | ***
78 |
79 | ## Errors
80 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
81 |
82 | - **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.
83 | - **404 Not Found** — The gallery you are requesting does not exist, or is private (and you are not its owner)
84 |
85 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
86 | [category]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#categories
87 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format
88 |
--------------------------------------------------------------------------------
/endpoints/galleries/GET_galleries_id_share_url.md:
--------------------------------------------------------------------------------
1 | # Galleries Resources
2 |
3 | ```
4 | GET users/:user_id/galleries/:id/share_url
5 | ```
6 |
7 | # Description
8 |
9 | Returns a sharable private URL for the given gallery.
10 |
11 | # Requires authentication
12 | * Requires a valid **[OAuth][]** request with an authorized Access Token.
13 |
14 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
15 |
16 | # Parameters
17 |
18 | None
19 |
20 | # Return format
21 |
22 | ```json
23 | {
24 | "share_url" : "g/"
25 | }
26 | ```
27 |
28 | # Errors
29 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
30 |
31 | - **404 Not Found** — The gallery you are requesting does not exist, or is private (and you are not its owner)
32 |
--------------------------------------------------------------------------------
/endpoints/galleries/POST_galleries.md:
--------------------------------------------------------------------------------
1 | # Galleries Resources
2 |
3 | POST users/:user_id/galleries
4 |
5 | ## Description
6 |
7 | Creates a new, empty gallery owned by the given user.
8 |
9 | ***
10 |
11 | ## Requires authentication
12 | **[OAuth][]**
13 |
14 | ## Parameters
15 |
16 | - **name** _(required)_ — Name for the gallery.
17 | - **description** — Description of the gallery. Default is blank.
18 | - **subtitle** — Subtitle of the gallery. Default is blank.
19 | - **privacy** — If 1, the gallery is marked private, otherwise it is public. Default is public.
20 | - **kind** _(required)_ - Must be one of the following **[gallery kinds][]**.
21 | - **custom_path** - A slug that the gallery will be accessible through. Needs to be unique to the user.
22 |
23 | ***
24 |
25 | ## Return format
26 | A JSON object containing **status** and **gallery** with the new Gallery object in **[full format][]**.
27 |
28 | ***
29 |
30 | ## Errors
31 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
32 |
33 | - **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.
34 | - **403 Forbidden** — You are not the user who will own the new gallery.
35 |
36 |
37 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
38 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format-3
39 | [gallery kinds]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#gallery-kinds
40 |
--------------------------------------------------------------------------------
/endpoints/galleries/PUT_galleries_id.md:
--------------------------------------------------------------------------------
1 | # Galleries Resources
2 |
3 | PUT users/:user_id/galleries/:id
4 |
5 | ## Description
6 |
7 | Updates the metadata for the given gallery.
8 |
9 | ***
10 |
11 | ## Requires authentication
12 | **[OAuth][]**
13 |
14 | ## Parameters
15 |
16 | - **name** — Sets the title for the gallery.
17 | - **description** — Description of the gallery.
18 | - **subtitle** — Updates the subtitle of the gallery.
19 | - **privacy** — If 1, the gallery is marked private, otherwise it is public.
20 | - **cover_photo_id** — Updates the gallery's cover photo, must be
21 | a pre-existing item in the gallery with valid photo and user.
22 | - **custom_path** - A slug that the gallery will be accessible through. Needs to be unique to the user.
23 |
24 | If a field is not provided, its current value is retained.
25 |
26 | ***
27 |
28 | ## Return format
29 | A JSON object with the key **gallery** that contains the updated Gallery object in **[full format][]**.
30 |
31 | ***
32 |
33 | ## Errors
34 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
35 |
36 | - **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.
37 | - **404 Not Found** — Photo with the specified ID does not exist.
38 | - **403 Forbidden** — You are not the owner of the gallery.
39 |
40 |
41 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
42 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format-3
43 |
--------------------------------------------------------------------------------
/endpoints/galleries/PUT_galleries_id_items.md:
--------------------------------------------------------------------------------
1 | # Galleries Resources
2 |
3 | PUT users/:user_id/galleries/:id/items
4 |
5 | ## Description
6 |
7 | Adds, removes, or updates the order of items in the gallery.
8 |
9 | ***
10 |
11 |
12 | ## Requires authentication
13 | **[OAuth][]**
14 |
15 | ***
16 |
17 | ## Parameters
18 | The input to this method should be a JSON body with these fields:
19 | - **add** — An optional hash directing that photos be inserted (or moved), in the following format:
20 | - **after** - If present, the items will be inserted after the described item. The **after** option is a hash in the following format:
21 | - **id** - The ID of the photo to insert the items after. If **id** is **null**, the photos are inserted at the beginning of the gallery.
22 | - **before** - If present, the items will be inserted before the described item. The **before** option is a hash in the following format:
23 | - **id** - The ID of the photo to insert the items before. If **id** is **null**, the photos are inserted at the end of the gallery.
24 | - **photos** - An array of Photo IDs to insert.
25 | - **remove** — Am optional hash directing that photos be removed, in the following format:
26 | - **photos** - An array of Photo IDs to remove.
27 |
28 | You cannot specify both **before** and **after** in a single request. If the ID of the photo in a **before** or **after** does not exist in the gallery, an error is returned. If neither **before** nor **after** are provided, the photos are inserted at the beginning of the gallery.
29 |
30 | You can provided an **add** or a **remove** directive, or both. If both directives are provided, the remove directive is performed first, so if a photo's ID appears in both directives, it will end up being present in the gallery after the operation completes.
31 |
32 | You can provide photos in the **add** directive that are already present in the gallery. The result of doing this will be to reorder the gallery so that the photos are removed from their current position (as if they had been included in the **remove** directive) and then added at the new position.
33 |
34 | It is an error to provide a photo as both a **before** or **after** and as a photo to insert.
35 |
36 | ***
37 |
38 | ## Return format
39 |
40 | An object mapping photo IDs to the operation performed ("added" or "removed"), see example.
41 |
42 | ***
43 |
44 | ## Errors
45 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
46 |
47 | - **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.
48 | - **403 Forbidden** — The gallery is not owned by you.
49 | - **403 Forbidden** — The photo was either deleted, is private, or belongs to a deactivated user.
50 | - **404 Not Found** — The gallery you are requesting does not exist.
51 | - **404 Not Found** — A photo you tried to add does not exist.
52 |
53 | ## Example
54 | **Request**
55 |
56 | PUT v1/users/23/galleries/4/items
57 |
58 | ``` json
59 | {
60 | "add": {
61 | "after": { "id": 5 },
62 | "photos": [ 1, 2, 3 ]
63 | },
64 | "remove": {
65 | "photos": [ 1, 4, 5 ]
66 | }
67 | }
68 | ```
69 |
70 | **Return**
71 | ``` json
72 | {
73 | "1": { "result": "added" },
74 | "2": { "result": "added" },
75 | "3": { "error": "Not found", "status": 404 },
76 | "4": { "result": "removed" },
77 | "5": { "result": "removed" }
78 | }
79 | ```
80 |
81 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
82 | [category]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#categories
83 |
--------------------------------------------------------------------------------
/endpoints/galleries/PUT_galleries_reposition.md:
--------------------------------------------------------------------------------
1 | # Galleries Resources
2 |
3 | PUT users/:user_id/galleries/reposition
4 |
5 | ## Description
6 |
7 | Bulk repositions galleries. Accepts a set of gallery ids, and repositions them in the given order at the end of the list of galleries. Optionally, galleries can be positioned relative to an existing gallery by specifying a `before_id` or `after_id`. **Specifying both will return an error**.
8 |
9 | ***
10 |
11 | ## Requires Authentication
12 | **[OAuth][]**
13 |
14 | ## Parameters
15 |
16 | - **galleries** _(required)_ - The set of gallery ids to reposition, separated by commas
17 | - **before_id** - The id of another gallery to position the galleries before
18 | - **after_id** - The id of another gallery to position the galleries after
19 |
20 | ***
21 |
22 | ## Return format
23 |
24 | Returns a JSON hash of gallery ids, and their reposition completion status (success or error)
25 |
26 | ***
27 |
28 | ## Errors
29 |
30 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
31 |
32 | - **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.
33 | - **401 Unauthorized** - You are not authenticated through OAuth.
34 | - **403 Forbidden** — You are not the owner of one or more of the galleries.
35 | - **404 Not Found** — One or more of the galleries with a specified ID does not exist.
36 |
37 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
38 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-3
39 |
--------------------------------------------------------------------------------
/endpoints/photo/DELETE_photos_id.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | DELETE photos/:id
4 |
5 | ## Description
6 | Deletes the photo from the User's library.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | **[OAuth][]**
12 |
13 | ***
14 |
15 | ## Parameters
16 |
17 | - **id** _(required)_ — The Photo ID to delete.
18 |
19 | ***
20 |
21 | ## Return format
22 | A JSON object containing keys: **status**, **message** and **error**(if happened).
23 |
24 | ***
25 |
26 | ## Errors
27 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
28 |
29 | - **403 Forbidden** — You do not own the photo you are trying to delete.
30 | - **404 Not Found** — The requested photo does not exist or was deleted.
31 |
32 | ***
33 |
34 | ## Example
35 | **Request**
36 |
37 | DELETE v1/photos/8359543
38 |
39 | **Return**
40 | ``` json
41 | {
42 | "status": 200,
43 | "message": "Successfully deleted a photo.",
44 | "error": "None"
45 | }
46 | ```
47 |
48 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
--------------------------------------------------------------------------------
/endpoints/photo/DELETE_photos_id_tags.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | DELETE photos/:id/tags
4 |
5 | ## Description
6 | Removes tags from the photo. Accepts one or multiple coma separated tags.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | **[OAuth][]**
12 |
13 | ***
14 |
15 | ## Parameters
16 | - **id** _(required)_ — The Photo ID to remove tags from.
17 | - **tags** _(required)_ — Coma separated tags.
18 |
19 | ***
20 |
21 | ## Return format
22 | A JSON object with key "status" and value of 200, and key "message" with value of "Successfully deleted tags."
23 |
24 | ***
25 |
26 | ## Errors
27 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
28 |
29 | - **404 Not Found** — The photo was not found.
30 |
31 | ***
32 |
33 | ## Example
34 | **Request**
35 |
36 | DELETE /v1/photos/8309863/tags?tags=cute,puppy
37 |
38 | **Return**
39 | ``` json
40 | {
41 | "status":200,
42 | "message":"Successfully deleted tags.",
43 | "error":"None"
44 | }
45 | ```
46 |
47 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
--------------------------------------------------------------------------------
/endpoints/photo/DELETE_photos_id_vote.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | DELETE photos/:photo_id/vote
4 |
5 | ## Description
6 | Unlikes the specified photo for the user.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | **[OAuth][]**
12 |
13 | ***
14 |
15 | ## Parameters
16 |
17 | - **id** _(required)_ — The Photo ID to unlike.
18 |
19 | ***
20 |
21 | ## Return format
22 | A JSON object containing keys: **status**, **message**, **photo** (in **[short format][]**) and **error**(if happened).
23 |
24 | ***
25 |
26 | ## Errors
27 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
28 |
29 | - **404 Not Found** — The requested photo does not exist or was deleted.
30 |
31 | ***
32 |
33 | ## Example
34 | **Request**
35 |
36 | DELETE v1/photos/8359543/vote
37 |
38 | **Return**
39 | ``` json
40 | {
41 | "status": 200,
42 | "message": "Successfully unliked photo.",
43 | "photo": {
44 | "id": 12345,
45 | "name": "photo1",
46 | ...
47 | }
48 | "error": "None"
49 | }
50 | ```
51 |
52 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
53 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format
54 |
--------------------------------------------------------------------------------
/endpoints/photo/GET_photos.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | GET photos
4 |
5 | ## Description
6 | Returns a listing of twenty (up to one hundred) photos for a specified **[photo stream][]**.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | * A valid Consumer Key must be provided in **consumer_key** parameter.
12 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
13 |
14 | ***
15 |
16 | ## Parameters
17 | - **feature** _(required)_ — Photo stream to be retrieved. Default *fresh_today*. Recognized values:
18 | ###### Global features
19 | - 'popular' — Return photos in Popular. Default sort: rating.
20 | - 'highest_rated' — Return photos that have been in Popular. Default sort: highest_rating.
21 | - 'upcoming' — Return photos in Upcoming. Default sort: time when Upcoming was reached.
22 | - 'editors' — Return photos in Editors' Choice. Default sort: time when selected by an editor.
23 | - 'fresh_today' — Return photos in Fresh Today. Default sort: time when reached fresh.
24 | - 'fresh_yesterday' — Return photos in Fresh Yesterday. Default sort: same as 'fresh_today'.
25 | - 'fresh_week' — Return photos in Fresh This Week. Default sort: same as 'fresh_today'.
26 |
27 | ###### Per-user features
28 | All per-user streams require a **user_id** or **username** parameter
29 |
30 | - 'user' - Return photos of a user, additional parameter 'user_id' or 'username' is required. Default sort: time uploaded.
31 | - 'user_friends' — Return photos by users the specified user is following. Default sort: time uploaded.
32 |
33 | - **only** — String name of the **[category][]** to return photos from. **Note:** Case sensitive, separate multiple values with a comma.
34 | - **exclude** — String name of the **[category][]** to exclude photos by. **Note:** Case sensitive, separate multiple values with a comma.
35 | - **sort** — Sort photos in the specified order.
36 | ###### Recognized values:
37 | - 'created_at' — Sort by time of upload
38 | - 'rating' — Sort by rating
39 | - 'highest_rating' — Sort by the highest rating the photo reached
40 | - 'times_viewed' — Sort by view count
41 | - 'votes_count' — Sort by votes count
42 | - 'comments_count' — Sort by comments count
43 | - 'taken_at' — Sort by the original date of the image extracted from metadata (might not be available for all images)
44 |
45 | - **sort_direction** — Control the order of the sorting. You can provide a **sort_direction** without providing a **sort**, in which case the default sort for the requested feature will be adjusted.
46 | ###### Recognized values:
47 | - 'asc' — Sort in ascending order (lowest or least-recent first)
48 | - 'desc' — Sort in descending order (highest or most-recent first). This is the default.
49 |
50 | - **page** — Return a specific page in the photo stream. Page numbering is 1-based.
51 | - **rpp** — The number of results to return. Can not be over 100, default 20.
52 | - **image_size** — The photo size(s) to be returned. See the documentation on **[photo sizes][]**.
53 |
54 |
55 | - **include_store** — If set to 1, returns market infomation about the photo.
56 | ###### Returned values:
57 | - 'store_download' — Boolean value if the picture is avaliable for HD Download purchase.
58 | - 'store_print' — Boolean value if the picture is avaliable for Canvas print purchase.
59 |
60 | - **include_states** — If set to 1, returns state of the photo for the currently logged in user and authenticated request.
61 | ###### Returned values:
62 | - 'liked' — Boolean value whether the current user has liked this photo
63 | - 'purchased' — Boolean value whether the current user has bought this photo
64 |
65 | - **personalized_categories** - If set to true, returns photos from personalized categories for the currently logged in user and authenticated request, if personalization is available for the current user.
66 |
67 | - **tags** — If set to 1, returns an array of tags for the photo.
68 |
69 | - **followers_count** - Filter the photo stream by number of followers each photo's user has. The expected value is `operator:N`. `Operator` can be one of `eq ne lt lte gt gte` (details below) and `N` is the number of followers. At the time of this documentation, the default for "Undiscovered photographers" is `lt:200`.
70 | - eq = `equals`
71 | - ne = `not equals`
72 | - lt = `less than`
73 | - lte = `less than or equals`
74 | - gt = `greater than`
75 | - gte = `greater than or equals`
76 |
77 | ***
78 |
79 | ## Return format
80 | An array with the following keys and values:
81 |
82 | - **feature** — Feature that is being returned.
83 | - **filters** — Additional filters that were used:
84 | - 'category' — The ID of the **[category][]** that photos were filtered by;
85 | - 'user_id' — The ID of the user specified by 'user_id' or 'username' parameters;
86 | - 'friends_ids' — IDs of users the user specified is following;
87 | - **current_page** — Number of the page that is returned.
88 | - **total_pages** — Total number of pages in this feature's stream.
89 | - **total_items** — Total number of items in this feature's stream.
90 | - **photos** — An array of Photo objects in **[short format](https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format)**.
91 |
92 | ***
93 |
94 | ## Errors
95 | None
96 |
97 | ***
98 |
99 | ## Example
100 | **Request**
101 |
102 | https://api.500px.com/v1/photos?feature=popular
103 |
104 | **Return** __shortened for example purpose__
105 | ``` json
106 | {
107 | "feature": "popular",
108 | "filters": {
109 | "category": false,
110 | "exclude": false
111 | },
112 | "current_page": 1,
113 | "total_pages": 250,
114 | "total_items": 5000,
115 | "photos": [
116 | {
117 | "id": 4910421,
118 | "name": "Orange or lemon",
119 | "description": "",
120 | "times_viewed": 709,
121 | "rating": 97.4,
122 | "created_at": "2012-02-09T02:27:16-05:00",
123 | "category": 0,
124 | "privacy": false,
125 | "width": 472,
126 | "height": 709,
127 | "votes_count": 88,
128 | "comments_count": 58,
129 | "nsfw": false,
130 | "image_url": "http://pcdn.500px.net/4910421/c4a10b46e857e33ed2df35749858a7e45690dae7/2.jpg",
131 | "user": {
132 | "id": 386047,
133 | "username": "Lluisdeharo",
134 | "firstname": "Lluis ",
135 | "lastname": "de Haro Sanchez",
136 | "city": "Sabadell",
137 | "country": "Catalunya",
138 | "fullname": "Lluis de Haro Sanchez",
139 | "userpic_url": "http://acdn.500px.net/386047/f76ed05530afec6d1d0bd985b98a91ce0ce49049/1.jpg?0",
140 | "upgrade_status": 0
141 | }
142 | },
143 | {
144 | "id": 4905955,
145 | "name": "R E S I G N E D",
146 | "description": "From the past of Tagus River, we have History and memories, some of them abandoned and disclaimed in their margins ...",
147 | "times_viewed": 842,
148 | "rating": 97.4,
149 | "created_at": "2012-02-08T19:00:13-05:00",
150 | "category": 0,
151 | "privacy": false,
152 | "width": 750,
153 | "height": 500,
154 | "votes_count": 69,
155 | "comments_count": 29,
156 | "nsfw": false,
157 | "image_url": "http://pcdn.500px.net/4905955/7e1a6be3d8319b3b7357c6390289b20c16a26111/2.jpg",
158 | "user": {
159 | "id": 350662,
160 | "username": "cresendephotography",
161 | "firstname": "Carlos",
162 | "lastname": "Resende",
163 | "city": "Forte da Casa",
164 | "country": "Portugal",
165 | "fullname": "Carlos Resende",
166 | "userpic_url": "http://acdn.500px.net/350662.jpg",
167 | "upgrade_status": 0
168 | }
169 | }
170 | ]
171 | }
172 | ```
173 |
174 | [photo stream]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#500px-photo-terms
175 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
176 | [http://500px.com/:username]: http://500px.com/iansobolev
177 | [http://500px.com/:username/following]: http://500px.com/iansobolev/following
178 | [category]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#categories
179 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
180 | [photo sizes]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#image-urls-and-image-sizes
181 |
--------------------------------------------------------------------------------
/endpoints/photo/GET_photos_id.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | GET photos/:id
4 |
5 | ## Description
6 | Returns detailed information of a single photo.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | * A valid Consumer Key must be provided in **consumer_key** parameter.
12 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
13 |
14 | ***
15 |
16 | ## Parameters
17 |
18 | - **image_size** — Numerical size of the image to link to, 1 being the smallest and 4 being the largest.
19 | - **comments** — Return comments to the photo in the response. Comments are returned in order of creation, 20 entries per page. If omitted no comments will be returned, if present comments will be returned.
20 | - **comments_page** — Return the specified page from the comments listing. Page numbers are 1-based.
21 | - **tags** — Returns an array of tags for the photo. If omitted no tags will be returned, if present tags will be returned.
22 |
23 | ***
24 |
25 | ## Return format
26 | A JSON object containing keys **photo** and **comments**, where **photo** is a Photo object in **[full format][]** and comments is a list of **comments** associated with the photo in the following format:
27 |
28 | - **id** — ID of the comment.
29 | - **user_id** — The ID of the author of the comment.
30 | - **to_whom_user_id** — Is always the ID of the author of the photo.
31 | - **body** — Text of the comment.
32 | - **created_at** - Creation of the comment
33 | - **parent_id** - Parent comment in case this comment is a reply.
34 | - **user** — Profile of the author of the comment in **[short format][]**.
35 |
36 |
37 | ### When requested with OAuth authentication, following keys will be included in the photo object:
38 |
39 | - **voted** — Whether the current user has voted for this photo, boolean
40 |
41 | ***
42 |
43 | ## Errors
44 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
45 |
46 | - **403 Forbidden** — The photo was either deleted, belongs to a deactivated user.
47 | - **404 Not Found** — Photo with the specified ID does not exist.
48 |
49 |
50 | ***
51 |
52 | ## Example
53 | **Request**
54 |
55 | v1/photos/4928401?comments
56 |
57 | **Return** __shortened for example purpose__
58 | ``` json
59 | {
60 | "photo": {
61 | "id": 4928401,
62 | "user_id": 164677,
63 | "name": "Northern Fulmar",
64 | "description": "Photographed during a pelagic trip east of Cape Cod. This seabird species only comes to land to nest and stays on the open sea the rest of the year. They can drink saltwater and excrete the excess salt through a gland on top of the bill.",
65 | "camera": "Canon EOS-1D Mark IV",
66 | "lens": "",
67 | "focal_length": "700",
68 | "iso": "400",
69 | "shutter_speed": "1/2000",
70 | "aperture": "6.3",
71 | "times_viewed": 167,
72 | "rating": 97.1,
73 | "status": 1,
74 | "created_at": "2012-02-09T21:11:53-05:00",
75 | "category": 11,
76 | "location": null,
77 | "privacy": false,
78 | "latitude": 41.75968637583948,
79 | "longitude": -68.935546875,
80 | "taken_at": "2010-11-13T08:37:37-05:00",
81 | "hi_res_uploaded": 0,
82 | "for_sale": false,
83 | "width": 588,
84 | "height": 750,
85 | "votes_count": 36,
86 | "comments_count": 36,
87 | "nsfw": false,
88 | "sales_count": 0,
89 | "for_sale_date": null,
90 | "highest_rating": 97.1,
91 | "highest_rating_date": "2012-04-16T15:05:56-04:00",
92 | "image_url": "http://pcdn.500px.net/4928401/16666558d7ba410f50922f86f736888d8cfaf9bb/4.jpg",
93 | "images": {"size": 4, "url": "http://pcdn.500px.net/4928401/16666558d7ba410f50922f86f736888d8cfaf9bb/4.jpg"}
94 | "store_download": false,
95 | "store_print": false,
96 | "voted": false,
97 | "purchased": false,
98 | "user": {
99 | "id": 164677,
100 | "username": "axelhildebrandt",
101 | "firstname": "Axel",
102 | "lastname": "Hildebrandt",
103 | "city": "Bethlehem",
104 | "country": "U.S.",
105 | "fullname": "Axel Hildebrandt",
106 | "userpic_url": "http://acdn.500px.net/164677.jpg",
107 | "upgrade_status": 0
108 | }
109 | },
110 | "comments": [
111 | {
112 | "id": 8482806,
113 | "user_id": 584607,
114 | "to_whom_user_id": 164677,
115 | "body": "Test",
116 | "created_at": "2012-04-16T15:07:54-04:00",
117 | "parent_id": null,
118 | "user": {
119 | "id": 584607,
120 | "username": "ArseniyIvanov",
121 | "firstname": "Arseniy",
122 | "lastname": "Ivanov",
123 | "fullname": "Arseniy Ivanov",
124 | "userpic_url": "http://acdn.500px.net/584607/36708ac62be191405639ad071f6bb772186c8679/1.jpg?103",
125 | "upgrade_status": 2
126 | }
127 | },
128 | {
129 | "id": 8477321,
130 | "user_id": 413718,
131 | "to_whom_user_id": 164677,
132 | "body": "Like!",
133 | "created_at": "2012-02-10T00:59:44-05:00",
134 | "parent_id": null,
135 | "user": {
136 | "id": 413718,
137 | "username": "SilviaSil",
138 | "firstname": "Silvia",
139 | "lastname": "S.",
140 | "fullname": "Silvia S.",
141 | "userpic_url": "/graphics/userpic.png",
142 | "upgrade_status": 0
143 | }
144 | }
145 | ]
146 | }
147 | ```
148 |
149 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
150 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
151 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format
152 |
--------------------------------------------------------------------------------
/endpoints/photo/GET_photos_id_comments.md:
--------------------------------------------------------------------------------
1 | # Comment Resources
2 |
3 | GET photos/:id/comments
4 |
5 | ## Description
6 | Returns a listing of twenty comments for the photo.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | A valid Consumer Key must be provided in **consumer_key** parameter.
12 |
13 | ***
14 |
15 | ## Parameters
16 |
17 | - **id** _(required)_ — The Photo ID to get comments for.
18 | - **page** — Return a specific page in the comment listing. Page numbering is 1-based.
19 | - **nested** - Include this parameter to return the comments in nested format.
20 |
21 | ***
22 |
23 | ## Return format
24 | An array with the following keys and values:
25 |
26 | - **media_type** — The type of object the comment belongs to (for blog comments this will be "blog_post").
27 | - **current_page** — Number of the page that is returned.
28 | - **total_pages** — Total number of pages in this feature's stream.
29 | - **total_items** — Total number of items in this feature's stream.
30 | - **comments** — An array of Comment objects in **full format** or **nested format** if you specified the `nested` parameter.
31 |
32 | ***
33 |
34 | ## Errors
35 |
36 | - **404 Not Found** — The requested photo does not exist or was deleted.
37 |
38 | ***
39 |
40 | ## Example
41 | **Request**
42 |
43 | v1/photos/4928401/comments
44 |
45 | **Return** (shortened for example purposes)
46 | ``` json
47 | {
48 | "media_type": "photo",
49 | "current_page": 1,
50 | "total_pages": 2,
51 | "total_items": 36,
52 | "comments": [
53 | {
54 | "id": 8471866,
55 | "user_id": 122216,
56 | "to_whom_user_id": 164677,
57 | "body": "Great image of a fascinating bird. Love the topside view.",
58 | "created_at": "2012-02-09T21:13:32-05:00",
59 | "parent_id": null,
60 | "user": {
61 | "id": 122216,
62 | "username": "haig",
63 | "firstname": "John",
64 | "lastname": "Haig",
65 | "city": "1000 Islands Twp.",
66 | "country": "Canada",
67 | "fullname": "John Haig",
68 | "userpic_url": "http://acdn.500px.net/122216/bd556f88c7fb9eaee93ff74c057a313c8911071a/1.jpg?48",
69 | "upgrade_status": 2
70 | }
71 | },
72 | {
73 | "id": 8471883,
74 | "user_id": 81920,
75 | "to_whom_user_id": 164677,
76 | "body": "The details on the feathers are perfect. Brilliant shot. ",
77 | "created_at": "2012-02-09T21:14:04-05:00",
78 | "parent_id": 8471866,
79 | "user": {
80 | "id": 81920,
81 | "username": "wisben",
82 | "firstname": "Manny ",
83 | "lastname": "Estrella",
84 | "city": "Arlington",
85 | "country": "USA",
86 | "fullname": "Manny Estrella",
87 | "userpic_url": "http://acdn.500px.net/81920.jpg",
88 | "upgrade_status": 0
89 | }
90 | }
91 | ]
92 | }
93 | ```
94 |
95 | **Nested Format**
96 |
97 | ```json
98 |
99 | {
100 | "media_type": "photo",
101 | "current_page": 1,
102 | "total_pages": 2,
103 | "total_items": 36,
104 | "comments": [
105 | {
106 | "id": 8471866,
107 | "user_id": 122216,
108 | "to_whom_user_id": 164677,
109 | "body": "Great image of a fascinating bird. Love the topside view.",
110 | "created_at": "2012-02-09T21:13:32-05:00",
111 | "parent_id": null,
112 | "user": {
113 | "id": 122216,
114 | "username": "haig",
115 | "firstname": "John",
116 | "lastname": "Haig",
117 | "city": "1000 Islands Twp.",
118 | "country": "Canada",
119 | "fullname": "John Haig",
120 | "userpic_url": "http://acdn.500px.net/122216/bd556f88c7fb9eaee93ff74c057a313c8911071a/1.jpg?48",
121 | "upgrade_status": 2
122 | },
123 | "replies": [
124 | {
125 | "id": 8471883,
126 | "user_id": 81920,
127 | "to_whom_user_id": 164677,
128 | "body": "The details on the feathers are perfect. Brilliant shot. ",
129 | "created_at": "2012-02-09T21:14:04-05:00",
130 | "parent_id": 8471866,
131 | "user": {
132 | "id": 81920,
133 | "username": "wisben",
134 | "firstname": "Manny ",
135 | "lastname": "Estrella",
136 | "city": "Arlington",
137 | "country": "USA",
138 | "fullname": "Manny Estrella",
139 | "userpic_url": "http://acdn.500px.net/81920.jpg",
140 | "upgrade_status": 0
141 | }
142 | }
143 | ]
144 | }
145 | ]
146 | }
147 | ````
148 |
--------------------------------------------------------------------------------
/endpoints/photo/GET_photos_id_votes.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | GET photos/:id/votes
4 |
5 | ## Description
6 | Returns all users that had liked this photo.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | * A valid **[OAuth][]** request with an authorized Access Token will be accepted.
12 |
13 | ***
14 |
15 | ## Parameters
16 |
17 | - **page** — Return a specific page in the photo stream. Page numbering is 1-based.
18 | - **rpp** — The number of results to return. Can not be over 100, default 20.
19 |
20 | ***
21 |
22 | ## Return format
23 | A JSON object containing users that liked that photo.
24 |
25 | - **current_page** — Number of the page that is returned.
26 | - **total_pages** — Total number of pages in this feature's stream.
27 | - **total_items** — Total number of items in this feature's stream.
28 | - **users** — Profile of the author of the comment in **[short format][]**.
29 |
30 | ***
31 |
32 | ## Errors
33 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
34 |
35 | - **403 Forbidden** — The photo was either deleted, belongs to a deactivated user.
36 | - **404 Not Found** — Photo with the specified ID does not exist.
37 |
38 |
39 | ***
40 |
41 | ## Example
42 | **Request**
43 |
44 | v1/photos/4928401/votes
45 |
46 | **Return** __shortened for example purpose__
47 | ``` json
48 | {
49 | "current_page": 1,
50 | "total_pages": 27,
51 | "total_items": 534,
52 | "users": [
53 | {
54 | "id": 477772,
55 | "username": "danendid",
56 | "firstname": "Estetic of",
57 | "lastname": "Senses",
58 | "city": "Brussels",
59 | "country": "Belgium",
60 | "fullname": "Estetic of Senses",
61 | "userpic_url": "http://acdn.500px.net/477772/fca7121758c49b13d33511662f0ecb4abb4097e9/1.jpg?126",
62 | "upgrade_status": 0
63 | },
64 | {
65 | "id": 490956,
66 | "username": "LK_fine_artist",
67 | "firstname": "Christian",
68 | "lastname": "Lamos",
69 | "city": "Budapest",
70 | "country": "Hungary",
71 | "fullname": "Christian Lamos",
72 | "userpic_url": "http://acdn.500px.net/490956/a5e57c142d21242c0d37de1e4f3b5f3688447a22/1.jpg?10",
73 | "upgrade_status": 0
74 | },
75 | {
76 | "id": 843534,
77 | "username": "Agnieszkauczywo",
78 | "firstname": "Agnieszka",
79 | "lastname": "Łuczywo",
80 | "city": null,
81 | "country": null,
82 | "fullname": "Agnieszka Łuczywo",
83 | "userpic_url": "/graphics/userpic.png",
84 | "upgrade_status": 0
85 | }
86 | ]
87 | }
88 | ```
89 |
90 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
91 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
92 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format
--------------------------------------------------------------------------------
/endpoints/photo/GET_photos_search.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | GET photos/search
4 |
5 | ## Description
6 | Returns a listing of twenty (up to one hundred) photos from search results for a specified tag, keyword, or location.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | * A valid Consumer Key must be provided in **consumer_key** parameter.
12 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
13 |
14 | ***
15 |
16 | ## Parameters
17 | Either of parameters **term**, **tag**, or **geo** is required.
18 |
19 | - **term** — A keyword to search for.
20 | - **tag** — A complete tag string to search for.
21 | - **geo** — A geo-location point of the format `latitude,longitude,radius`. Acceptable `units` are `km` or `mi`.
22 | - **only** — String name of the **[category][]** to return photos from. **Note:** Multiple categories may be given, separated by commas, e.g. `Fashion,Black and White`
23 | - **was_featured_type** - search only certain feature categories, the [accepted values are the same as for the `GET /photos` endpoint](https://github.com/500px/api-documentation/blob/master/endpoints/photo/GET_photos.md#global-features)
24 | - **exclude** — String name of the **[category][]** to exclude from the results. **Note:** Multiple categories may be given, separated by commas, e.g. `People,Nude`
25 | - **exclude_nude=1** - Specifically exclude all photos marked as NSFW. **Note:** We do our best to ensure all NSFW photos are marked as such, but we are unable to guarantee that this will always be the case.
26 | - **page** — Return a specific page. Page numbering is 1-based.
27 | - **rpp** — The number of results to return. Can not be over 100, default 20.
28 | - **tags** — Returns an array of tags for each photo.
29 | - **user_id** — Limit your search within photos of the given user.
30 | - **image_size** — The photo size(s) to be returned. See the documentation on **[photo sizes][]**.
31 | - **license_type** -- Restrict the results to one or more **[license types][]**. Multiple types can be separated with a comma: `license_type=1,4`.
32 | - **sort** — Sort photos in the specified order. The following values are recognized:
33 | - **_score** — Sort by query score, best match first.
34 | - **created_at** — Default: sort by time of upload, most recent first.
35 | - **rating** — Sort by current rating, highest rated first.
36 | - **highest_rating** — Sort by highest rating achieved, highest rated first.
37 | - **times_viewed** — Sort by the number of views, most viewed first.
38 | - **votes_count** – Sort by the number of votes, most voted on first.
39 | - **comments_count** — Sort by the number of comments, most commented first.
40 | - **taken_at** — Sort by the original date of the image extracted from metadata, most recent first (might not be available for all images).
41 |
42 | ## Return format
43 | An array with the following keys and values:
44 |
45 | - **current_page** — Number of the page that is returned.
46 | - **total_pages** — Total number of pages in this feature's stream.
47 | - **total_items** — Total number of items in this feature's stream.
48 | - **photos** — An array of Photo objects in **[short format][]**. The objects will also include `latitude` and `longitude` attributes if the results are based on the geo-location search.
49 |
50 | ***
51 |
52 | ## Errors
53 | - **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.
54 |
55 |
56 | ***
57 |
58 | ## Example
59 | **Request**
60 |
61 | GET v1/photos/search?term=bike
62 |
63 | ## Return __shortened for example purpose__
64 | ``` json
65 | {
66 | "current_page": 1,
67 | "total_pages": 50,
68 | "total_items": 8263,
69 | "photos": [
70 | {
71 | "id": 4930535,
72 | "name": "Bike",
73 | "description": "",
74 | "times_viewed": 28,
75 | "rating": 27,
76 | "created_at": "2012-02-10T00:39:03-05:00",
77 | "category": 21,
78 | "privacy": false,
79 | "width": 2500,
80 | "height": 1883,
81 | "votes_count": 1,
82 | "comments_count": 0,
83 | "nsfw": false,
84 | "image_url": "http://pcdn.500px.net/4930535/140c1f84fb63be76884b2b60350c6b6d75c2433f/2.jpg",
85 | "user": {
86 | "id": 171927,
87 | "username": "MarkBrunner",
88 | "firstname": "mark",
89 | "lastname": "Brunner",
90 | "city": "Haslett",
91 | "country": "united States",
92 | "fullname": "mark Brunner",
93 | "userpic_url": "http://acdn.500px.net/171927.jpg",
94 | "upgrade_status": 0
95 | }
96 | },
97 | {
98 | "id": 4930206,
99 | "name": "Rain",
100 | "description": "",
101 | "times_viewed": 1,
102 | "rating": 59.7,
103 | "created_at": "2012-02-10T00:04:09-05:00",
104 | "category": 21,
105 | "privacy": false,
106 | "width": 4542,
107 | "height": 3042,
108 | "votes_count": 1,
109 | "comments_count": 1,
110 | "nsfw": false,
111 | "image_url": "http://pcdn.500px.net/4930206/bedeed09e5a15014c558aa59de29bd40c4212811/2.jpg",
112 | "user": {
113 | "id": 578359,
114 | "username": "mikecruzphotography",
115 | "firstname": "Mike",
116 | "lastname": "Cruz",
117 | "city": "",
118 | "country": "Singapore",
119 | "fullname": "Mike Cruz",
120 | "userpic_url": "http://acdn.500px.net/578359/600796b98145b21fb3b35bc7c5ce001db1b4ea4a/1.jpg?127",
121 | "upgrade_status": 0
122 | }
123 | }
124 | ]
125 | }
126 | ```
127 |
128 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
129 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
130 | [category]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#categories
131 | [license types]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#license-types
132 | [photo sizes]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#image-urls-and-image-sizes
133 |
--------------------------------------------------------------------------------
/endpoints/photo/POST_photos.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | POST photos
4 |
5 | ## Description
6 | Create a new photo on behalf of the user, and receive an **[upload key][]** in exchange.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | **[OAuth][]**
12 |
13 | ***
14 |
15 | ## Parameters
16 | Essential information:
17 |
18 | - **name** — Title of the photo
19 | - **description** — Description for the photo
20 | - **category** — A numerical ID for the **[Category][]** of the photo
21 | - **auto_activate** - Set this to 'true' if the photo should be automatically marked as active as soon as it's uploaded. It this parmeter is not included, the photo will not be automatically marked as active after upload.
22 |
23 |
24 | Technical details of the photo: (this information may be overridden when the file is uploaded and parsed for EXIF and IPTC tags)
25 |
26 | - **shutter_speed** — Shutter speed in seconds, represented by string containing a rational expression if the value is <1 sec., or a decimal value if the value is >1sec.
27 | - **focal_length** — Focal length in millimetres, a string representing an integer value
28 | - **aperture** — Aperture value
29 | - **iso** — ISO value
30 | - **camera** — Make and model of the camera. Note: Please make sure it contains sensible information (eg., does not contain camera's make or model twice)
31 | - **lens** — Lens used to make this photo
32 |
33 | ### Geographical information of the photo:
34 |
35 | - **latitude** — Latitude, in decimal format
36 | - **longitude** — Longitude, in decimal format
37 |
38 | ### Optional attributes:
39 |
40 | - **tags** — Comma-separated list of tags to apply to the photo.
41 | - **privacy** — Whether to hide the photo from the user profile on the website. Otherwise, the photo is only available for use in Collections/Portfolio. Recognized values: 1 for private, 0 for public.
42 |
43 | ***
44 |
45 | ## Return format
46 | Status code 200, along with a JSON array containing photo and 'upload_key' keys, where value of photo is an object representing the Photo information in **[short format][]**, and **['upload_key'](https://github.com/500px/api-documentation/blob/master/authentication/upload_key.md)** is the token to be used by the client to upload the file. Also included is **['presigned_post'](https://github.com/500px/api-documentation/blob/master/authentication/presigned_post.md)** this is to be used for authenticating a direct upload to S3.
47 |
48 |
49 | ***
50 |
51 | ## Errors
52 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
53 |
54 | - **422 Unprocessable Entity** — The system had trouble saving the record. You may retry again.
55 |
56 | ***
57 |
58 | ## Example
59 | **Request**
60 |
61 | POST v1/photos?name=Hello&description=World&tags=some,useful,tags
62 |
63 |
64 | **Return**
65 | ``` json
66 | {
67 | "upload_key": "89653832030e7d26daf3a43fc2ccd501",
68 | "presigned_post": {
69 | "url": "https://s3.amazonaws.com/photos.500px.net",
70 | "fields": {
71 | "key": "...",
72 | "x-amz-meta-user_id": "173",
73 | "x-amz-signature": "...",
74 | "x-amz-algorithm": "...",
75 | "x-amz-credential": "...",
76 | "x-amz-date": "20120608131704Z"
77 | },
78 | },
79 | "photo": {
80 | "id": 10000277,
81 | "user_id": 173,
82 | "name": "Hello",
83 | "description": "World",
84 | "camera": null,
85 | "lens": null,
86 | "focal_length": null,
87 | "iso": null,
88 | "shutter_speed": null,
89 | "aperture": null,
90 | "times_viewed": 0,
91 | "rating": null,
92 | "status": 0,
93 | "created_at": "2012-06-08T13:17:14-04:00",
94 | "category": 0,
95 | "location": null,
96 | "privacy": false,
97 | "latitude": null,
98 | "longitude": null,
99 | "taken_at": null,
100 | "hi_res_uploaded": 0,
101 | "for_sale": false,
102 | "width": null,
103 | "height": null,
104 | "votes_count": 0,
105 | "comments_count": 0,
106 | "nsfw": false,
107 | "sales_count": 0,
108 | "for_sale_date": null,
109 | "highest_rating": 0,
110 | "highest_rating_date": null
111 | }
112 | }
113 | ```
114 |
115 | [upload key]: https://github.com/500px/api-documentation/blob/master/authentication/upload_key.md
116 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
117 | [Category]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#categories
118 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
119 |
--------------------------------------------------------------------------------
/endpoints/photo/POST_photos_id_comments.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | POST photos/:id/comments
4 |
5 | ## Description
6 | Creates a new comment for the photo.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | **[OAuth][]**
12 |
13 | ***
14 |
15 | ## Parameters
16 | - **id** _(required)_ — The Photo ID to post comments for.
17 | - **body** _(required)_ — Content of the comment.
18 |
19 | ***
20 |
21 | ## Return format
22 | A JSON object with key "status" and value of 200, a key "message" with value of "Successfully added a comment.", and a key of "comment" including the comment model of the comment that was created.
23 |
24 | ***
25 |
26 | ## Errors
27 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
28 |
29 | - **400 Bad Request** — The body of the comment was not specified.
30 | - **404 Not Found** — The photo was not found.
31 |
32 | ***
33 |
34 | ## Example
35 | **Request**
36 |
37 | POST /v1/photos/8309863/comments
38 |
39 | **Body**
40 |
41 | body=I+like+your+photo
42 |
43 | **Return**
44 | ``` json
45 | {
46 | "status":200,
47 | "message":"Successfully added a comment.",
48 | "error":"None",
49 | "comment": {
50 | "id": 83858343,
51 | "user_id": 198867,
52 | "to_whom_user_id": 347823,
53 | "body": "I like your photo",
54 | "created_at": "2013-02-25T17:35:26-05:00",
55 | "parent_id": null,
56 | "flagged": false,
57 | "rating": 0,
58 | "voted": false,
59 | "user": {
60 | "id": 198867,
61 | "username": "tye",
62 | "firstname": "Tye",
63 | "lastname": "Shavik",
64 | "city": "Toronto",
65 | "country": "Canada",
66 | "fullname": "Tye Shavik",
67 | "userpic_url": "http://acdn.500px.net/198867/7f5f29fd33e093062a30e2bf3a9e605c446ba960/1.jpg?29",
68 | "upgrade_status": 2,
69 | "followers_count": 36,
70 | "affection": 103,
71 | "admin": 1
72 | }
73 | }
74 | }
75 | ```
76 |
77 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
78 |
--------------------------------------------------------------------------------
/endpoints/photo/POST_photos_id_report.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | POST photos/:id/report
4 |
5 | ## Description
6 | Allows to report a photo.
7 |
8 | ***
9 |
10 | ## Parameters
11 |
12 | - **id** _(required)_ — ID of the photo to report.
13 | - **reason** _(required)_ — Reason for the report
14 | - '1' — Offensive (rude, obscene)
15 | - '2' — Spam (ads, self-promotion)
16 | - '3' — Offtopic (trolling)
17 | - '4' — Copyright (plagiarism, stealing)
18 | - '5' — Wrong content (illustration, 3D)
19 | - '6' — Should be tagged as adult content
20 | - '0' — Other, request should ideally also include **reason_details**
21 | - **reason_details** — Additional information about the report, as a text blob
22 |
23 | ***
24 |
25 | ## Return format
26 | A JSON object containing success attribute.
27 |
28 | ***
29 |
30 | ## Errors
31 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
32 |
33 | - **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.
34 | - **404 Not Found** — Photo with the specified ID does not exist.
35 |
36 | ***
37 |
38 | ## Example
39 | **Request**
40 |
41 | POST /v1/photos/112116/report
42 |
43 | **Return**
44 | ``` json
45 | {
46 | "success": true
47 | }
48 | ```
49 |
--------------------------------------------------------------------------------
/endpoints/photo/POST_photos_id_tags.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | POST photos/:id/tags
4 |
5 | ## Description
6 | Adds tags to the photo. Accepts one or multiple coma separated tags.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | **[OAuth][]**
12 |
13 | ***
14 |
15 | ## Parameters
16 | - **id** _(required)_ — The Photo ID to add tags for.
17 | - **tags** _(required)_ — Coma separated tags.
18 |
19 | ***
20 |
21 | ## Return format
22 | A JSON object with key "status" and value of 200, and key "message" with value of "Successfully added tags."
23 |
24 | ***
25 |
26 | ## Errors
27 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
28 |
29 | - **404 Not Found** — The photo was not found.
30 |
31 | ***
32 |
33 | ## Example
34 | **Request**
35 |
36 | POST /v1/photos/8309863/tags
37 |
38 | **Body**
39 |
40 | tags=cute,puppy
41 |
42 | **Return**
43 | ``` json
44 | {
45 | "status":200,
46 | "message":"Successfully added tags.",
47 | "error":"None"
48 | }
49 | ```
50 |
51 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
--------------------------------------------------------------------------------
/endpoints/photo/POST_photos_id_vote.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | POST photos/:id/vote
4 |
5 | ## Description
6 | Allows the user to vote for a photo.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | **[OAuth][]**
12 |
13 | ***
14 |
15 | ## Parameters
16 |
17 | - **id** _(required)_ — ID of the photo the vote is cast upon.
18 | - **vote** _(required)_ — vote, values: '0' for 'dislike' or '1' for 'like'.
19 |
20 | ***
21 |
22 | ## Return format
23 | A JSON object containing key **photo**, where **photo** is a Photo object in [full format][].
24 |
25 | ***
26 |
27 | ## Errors
28 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
29 |
30 | - **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.
31 | - **403 Forbidden** — The vote has been rejected; common reasons are: current user is inactive, has not completed their profile, is trying to vote on their own photo, or has already voted for the photo.
32 | - **404 Not Found** — Photo with the specified ID does not exist.
33 |
34 | ***
35 |
36 | ## Example
37 | **Request**
38 |
39 | POST /v1/photos/112116/vote?vote=1
40 |
41 | **Return**
42 | ``` json
43 | {
44 | "photo": {
45 | "id": 4928402,
46 | "user_id": 69241,
47 | "name": "Guitar",
48 | "description": "",
49 | "camera": "Canon EOS rebel T2i",
50 | "lens": null,
51 | "focal_length": "35",
52 | "iso": "400",
53 | "shutter_speed": "1/20",
54 | "aperture": "2",
55 | "times_viewed": 4,
56 | "rating": 27,
57 | "status": 1,
58 | "created_at": "2012-02-09T21:12:01-05:00",
59 | "category": 5,
60 | "location": null,
61 | "privacy": false,
62 | "latitude": null,
63 | "longitude": null,
64 | "taken_at": "2012-02-09T14:50:29-05:00",
65 | "hi_res_uploaded": 0,
66 | "for_sale": false,
67 | "width": 5184,
68 | "height": 3456,
69 | "votes_count": 1,
70 | "comments_count": 0,
71 | "nsfw": false,
72 | "sales_count": 0,
73 | "for_sale_date": null,
74 | "highest_rating": 66.5287,
75 | "highest_rating_date": "2009-11-14T09:26:56-05:00",
76 | "image_url": "http://pcdn.500px.net/4928402/5868f8b7f020e4f7ce75fd8f1b66c6f75f53bd4f/4.jpg",
77 | "user": {
78 | "id": 69241,
79 | "username": "rileywiebe",
80 | "firstname": "Riley",
81 | "lastname": "Wiebe",
82 | "city": "Swift Current",
83 | "country": "Canada",
84 | "fullname": "Riley Wiebe",
85 | "userpic_url": "http://acdn.500px.net/69241.jpg",
86 | "upgrade_status": 0
87 | }
88 | }
89 | }
90 | ```
91 |
92 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
93 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format
94 |
--------------------------------------------------------------------------------
/endpoints/photo/PUT_photos_id.md:
--------------------------------------------------------------------------------
1 | # Updating a Photo's Information
2 |
3 | PUT photos/:id
4 |
5 | ## Description
6 |
7 | Allows the client application to update user-editable information on a photo.
8 |
9 | ## Resource URL
10 |
11 | https://api.500px.com/v1/photos/:id
12 |
13 | ## Authentication
14 |
15 | **Required;** [OAuth][]. The client application must use the OAuth access token issued for the owner of the photo to access this resouce.
16 |
17 | ## Parameters
18 |
19 | The application must provide the ID of the photo to update in the URL of the request. The following parameters are recognized when included in the query string or POST body:
20 |
21 | - **name**: Title of the photo, up to 255 characters in length.
22 | - **description**: Text description of the photo, up to 65535 characters in length.
23 | - **category**: Integer number of the category of the photo. See [category mapping][] for exact values.
24 | - **tags**: Comma-separated list of tags applicable to this photo.
25 | - **add_tags**: Comma-separated list of tags to add to this photo's existing tags.
26 | - **remove_tags**: Comma-separated list of tags to remove from this photo's existing tags.
27 | - **shutter_speed**: Shutter speed value for the photo, internally stored as string.
28 | - **focal_length**: Focal length value for the photo, internally stored as string.
29 | - **aperture**: Aperture value value for the photo, internally stored as string.
30 | - **iso**: Integer ISO value for the photo.
31 | - **camera**: Make and model of the camera used to take this photo.
32 | - **lens**: Information about the lens used to take this photo.
33 | - **latitude**: Latitude of the location this photo was taken at represented by a decimal number.
34 | - **longitude**: Longitude of the location this photo was taken at represented by a decimal number.
35 | - **nsfw**: Boolean value indicating that the photo may contain not-safe-for-work content or content not suitable for minors.
36 | - **license_type**: Integer number of the license type chosen for this photo. See [license type mapping][] for exact values.
37 | - **privacy**: Integer value indicating that the photo should be shown (`0`) or hidden (`1`) on the user's profile.
38 | - **crop**: A hash containing keys `x`, `x2`, `y`, `y2` and representing coordinates within which the thumbnail must be cropped. The crop is made using the top left corner as the origin. The points must be given relative to image size `4`, an image of at most 900px on the larger side. The client application may skip this if the user does not wish to change photo thumbnail.
39 |
40 | ## Implementation details
41 |
42 | A parameter missing from the request will not be updated. A parameter set to an empty string or null value will be interpreted as the user wishing to reset the value of the field to its default value.
43 |
44 | You can use the `add_tags` and `remove_tags` parameters to manupulate a photo's tags without having to send the complete list of tags in the request.
45 |
46 | ## Return format
47 |
48 | A JSON object containing key **photo**, where **photo** is a Photo object in **[full format][]**.
49 |
50 | ## Errors
51 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
52 |
53 | - **401: Invalid OAuth request**: The request was refused because the OAuth signature is incorrect.
54 | - **404: Photo with ID not found**: The photo ID provided is not known to the system.
55 | - **404: Photo with ID has been deleted**: The photo has been deleted and can not be edited.
56 | - **404: Photo with ID belongs to a deactivated user**: The photo belongs to a user that is no longer active and can not be edited.
57 | - **400: Bad photo category**: An unrecognized photo category value has been provided.
58 | - **400: Bad license type**: An unrecognized license type value has been provided.
59 |
60 | ***
61 |
62 | ## Example
63 | **Request**
64 |
65 | PUT v1/photos/40840326?name=Toronto%20Sky%20vs%20City%20Hall&category=9&description=A%20panoramic%20shot%20taken%20with%20an%20Android%20camera%20on%20the%20evening%20of%20Jul%2019th.
66 |
67 | **Return**
68 |
69 | ```
70 | {
71 | "photo": {
72 | "id": 40840326,
73 | "user_id": 3798,
74 | "name": "Toronto Sky vs City Hall",
75 | "description": "A panoramic shot taken with an Android camera on the evening of Jul 19th.",
76 | "camera": "Nexus 4",
77 | "lens": null,
78 | "focal_length": null,
79 | "iso": "",
80 | "shutter_speed": null,
81 | "aperture": null,
82 | "times_viewed": 2,
83 | "rating": 0.0,
84 | "status": 1,
85 | "created_at": "2013-07-20T01:14:52-04:00",
86 | "category": 9,
87 | "location": null,
88 | "privacy": 0,
89 | "latitude": null,
90 | "longitude": null,
91 | "taken_at": "2013-07-19T20:59:26-04:00",
92 | "hi_res_uploaded": 0,
93 | "for_sale": false,
94 | "width": 3464,
95 | "height": 1608,
96 | "votes_count": 0,
97 | "comments_count": 0,
98 | "sales_count": 0,
99 | "highest_rating": 0.0,
100 | "highest_rating_date": null,
101 | "license_type": 0,
102 | "converted": 27,
103 | "image_url": "http://pcdn.500px.net/40840326/c828635b422c28af135f255f9a8323c16ea8340a/4.jpg",
104 | "user": {
105 | "id": 3798,
106 | "username": "freeatnet",
107 | "firstname": "Arseniy",
108 | "lastname": "Ivanov",
109 | "city": "Toronto",
110 | "country": "Canada",
111 | "fullname": "Arseniy Ivanov",
112 | "userpic_url": "http://acdn.500px.net/3798/25f3e0e4783a25983b79df3a3966461f3ca10d57/1.jpg?1",
113 | "upgrade_status": 2,
114 | "followers_count": 156,
115 | "affection": 90,
116 | "admin": 1
117 | }
118 | }
119 | }
120 | ```
121 |
122 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
123 | [category mapping]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#categories
124 | [license type mapping]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#license-types
125 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format
126 |
--------------------------------------------------------------------------------
/endpoints/template.md:
--------------------------------------------------------------------------------
1 | # Photo Resources
2 |
3 | GET example/:id
4 |
5 | ## Description
6 |
7 | ***
8 |
9 | ## Requires authentication
10 |
11 | ***
12 |
13 | ## Parameters
14 |
15 | ***
16 |
17 | ## Return format
18 |
19 | ***
20 |
21 | ## Errors
22 |
23 | ***
24 |
25 | ## Example
26 | **Request**
27 |
28 | Code Example
29 |
30 | **Return**
31 |
32 | Code Example
33 |
34 |
35 | [photo stream]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#500px-photo-terms
36 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
37 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format
38 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
39 | [category]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#categories
--------------------------------------------------------------------------------
/endpoints/user/DELETE_users_id_friends.md:
--------------------------------------------------------------------------------
1 | # User Resources
2 |
3 | DELETE users/:id/friends
4 |
5 | ## Description
6 | Removes the user from the list of followers.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | * A valid Consumer Key must be provided in **consumer_key** parameter.
12 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
13 |
14 | ***
15 |
16 | ## Parameters
17 |
18 | - **id** _(required)_ — ID of the User to remove from the followers list.
19 |
20 | ***
21 |
22 | ## Return format
23 | A JSON array with un-followed User object.
24 |
25 | ***
26 |
27 | ## Errors
28 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
29 |
30 | - **403 Forbidden** — The user requested has been disabled or not in followers list.
31 | - **404 Not Found** — User does not exist in our database.
32 |
33 | ***
34 |
35 | ## Example
36 | **Request**
37 |
38 | DELETE v1/users/827595/friends
39 |
40 | **Return**
41 | ``` json
42 | {
43 | user: {
44 | id: 827595,
45 | username: "voldemarpetruskauskus",
46 | firstname: "Voldemar",
47 | lastname: "Petruskauskus",
48 | birthday: null,
49 | sex: 0,
50 | city: "",
51 | state: "",
52 | country: "",
53 | registration_date: "2012-05-15T11:19:42-04:00",
54 | about: "Voldemar",
55 | domain: null,
56 | upgrade_status: 9,
57 | fotomoto_on: false,
58 | locale: "en",
59 | show_nude: false,
60 | store_on: false,
61 | contacts: { },
62 | equipment: { }
63 | }
64 | }
65 | ```
66 |
67 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
68 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
--------------------------------------------------------------------------------
/endpoints/user/GET_users.md:
--------------------------------------------------------------------------------
1 | # User Resources
2 |
3 | GET users
4 |
5 | ## Description
6 | Returns the profile information for the current user.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | **[OAuth][]**
12 |
13 | ***
14 |
15 | ## Parameters
16 | None
17 |
18 | ***
19 |
20 | ## Return format
21 | Current user's profile information in **[full format][]**.
22 |
23 | Additional data:
24 |
25 | - **upload_limit** — the number of photos the user may upload at this moment, integer.
26 | - **upload_limit_expiry** — date and time of the beginning of the new upload limit cycle, datetime.
27 | - **show_personalized_categories** - checks if the user can see personalized photo categories, boolean.
28 | - **gdpr_acceptance_timestamp** - timestamp of when a user accepted the GDPR-compliant EULA.
29 |
30 | ***
31 |
32 | ## Errors
33 | None.
34 |
35 | ***
36 |
37 | ## Example
38 | **Request (Using [OAuth][])**
39 |
40 | https://api.500px.com/v1/users
41 |
42 | **Return**
43 | ``` json
44 | {
45 | "user": {
46 | "id": 173,
47 | "username": "vovko",
48 | "firstname": "Voldemar",
49 | "lastname": "Petruskauskus",
50 | "birthday": null,
51 | "sex": 0,
52 | "city": "",
53 | "state": "",
54 | "country": "",
55 | "active": 1,
56 | "registration_date": "2009-11-08T12:41:14-05:00",
57 | "about": "lbalblabla",
58 | "domain": "vovko.500px.com",
59 | "upgrade_status": 2,
60 | "fotomoto_on": false,
61 | "locale": "en",
62 | "show_nude": true,
63 | "store_on": false,
64 | "contacts": {
65 | "website": "www.drizhepolov.com",
66 | "twitter": "vovko",
67 | "livejournal": "vovko",
68 | "flickr": "Vladimir Drizhepolov",
69 | "gtalk": "vladimir@drizhepolov.com",
70 | "skype": "trulllllll",
71 | "facebook": "562874260",
72 | "facebookpage": "www.facebook.com/vovko"
73 | },
74 | "equipment": {
75 | "camera": [
76 | "Kiev 88",
77 | "Lomo Rocket",
78 | "Lomo Action sampler"
79 | ],
80 | "lens": [
81 | "Volna 80mm"
82 | ]
83 | },
84 | "fullname": "Voldemar Petruskauskus",
85 | "userpic_url": "http://acdn.500px.net/173.jpg",
86 | "email": "vladimir@drizhepolov.com",
87 | "photos_count": 5,
88 | "galleries_count": 5,
89 | "affection": 7,
90 | "friends_count": 37,
91 | "followers_count": 7,
92 | "upload_limit": null,
93 | "upload_limit_expiry": "2012-06-08T14:30:28-04:00",
94 | "upgrade_status_expiry": "2012-12-12",
95 | "show_personalized_categories": true,
96 | "auth": {
97 | "facebook": 0,
98 | "twitter": 0
99 | }
100 | }
101 | }
102 | ```
103 |
104 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
105 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#profile-format
106 |
--------------------------------------------------------------------------------
/endpoints/user/GET_users_id_followers.md:
--------------------------------------------------------------------------------
1 | # User Resources
2 |
3 | GET users/:id/followers
4 |
5 | ## Description
6 | Returns a list of users who follow the specified user.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | * A valid Consumer Key must be provided in **consumer_key** parameter.
12 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
13 |
14 | ***
15 |
16 | ## Parameters
17 |
18 | - **id** _(required)_ — ID of the user.
19 | - **page** — Return the specified page of the resource. Page numbering is 1-based.
20 | - **rpp** — Results Per Page, default 20, max 100.
21 |
22 |
23 | ***
24 |
25 | ## Return format
26 | A JSON array with keys:
27 |
28 | - **followers_count** — Total number of followers.
29 | - **followers_pages** — The total number of pages available in this resource.
30 | - **page** — Number of the page currently being returned.
31 | - **followers** — An indexed array of User objects in **[short format][]**.
32 |
33 | ***
34 |
35 | ## Errors
36 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
37 |
38 | - **403 Forbidden** — The user requested has been disabled.
39 | - **404 Not Found** — User does not exist in our database.
40 |
41 | ***
42 |
43 | ## Example
44 | **Request**
45 |
46 | GET v1/users/173/followers
47 |
48 | **Return** __shortened for example purpose__
49 | ``` json
50 | {
51 | "followers_count": 7,
52 | "followers_pages": 1,
53 | "page": 1,
54 | "followers": [
55 | {
56 | "id": 457180,
57 | "username": "mgcirillo",
58 | "firstname": "Mike",
59 | "lastname": "Cirillo",
60 | "city": "Toronto",
61 | "country": "Canada",
62 | "fullname": "Mike Cirillo",
63 | "userpic_url": "http://acdn.500px.net/457180/bcbec7f69f5275d5ecf189bc05f07ab2560b2b22/1.jpg?0",
64 | "upgrade_status": 2
65 | },
66 | {
67 | "id": 12150,
68 | "username": "MaksimPo",
69 | "firstname": "Maksim",
70 | "lastname": "p.",
71 | "city": "tallinn",
72 | "country": "estonia",
73 | "fullname": "Maksim p.",
74 | "userpic_url": "http://external.ak.fbcdn.net/safe_image.php?d=47fb0c08b05d512cf1afaa8866774b39&url=http%3A%2F%2Fprofile.ak.fbcdn.net%2Fhprofile-ak-snc4%2F41765_100000921361830_4251_n.jpg&logo&v=5",
75 | "upgrade_status": 0
76 | },
77 | {
78 | "id": 2,
79 | "username": "oleggutsol",
80 | "firstname": "Oleg",
81 | "lastname": "Gutsol",
82 | "city": "Toronto",
83 | "country": "Canada",
84 | "fullname": "Oleg Gutsol",
85 | "userpic_url": "http://acdn.500px.net/2/3aa7abe3aebc904c575c504e91fde4bb9f8baab9/1.jpg?11",
86 | "upgrade_status": 2
87 | }
88 | ]
89 | }
90 | ```
91 |
92 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
93 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
94 |
--------------------------------------------------------------------------------
/endpoints/user/GET_users_id_friends.md:
--------------------------------------------------------------------------------
1 | # User Resources
2 |
3 | GET users/:id/friends
4 |
5 | ## Description
6 | Returns a list of friends for the specified user.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | * A valid Consumer Key must be provided in **consumer_key** parameter.
12 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
13 |
14 | ***
15 |
16 | ## Parameters
17 |
18 | - **id** _(required)_ — Return information for the specified user ID
19 | - **page** — Return the specified page of the resource. Page numbering is 1-based.
20 | - **rpp** — Results Per Page, default 20, max 100.
21 |
22 | ***
23 |
24 | ## Return format
25 | A JSON array with keys:
26 |
27 | - **friends_count** — Total number of friends.
28 | - **friends_pages** — The total number of pages available in this resource.
29 | - **page** — Number of the page currently being returned.
30 | - **friends** — An indexed array of User objects in **[short format][]**.
31 |
32 | ***
33 |
34 | ## Errors
35 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
36 |
37 | - **403 Forbidden** — The user requested has been disabled.
38 | - **404 Not Found** — User does not exist in our database.
39 |
40 | ***
41 |
42 | ## Example
43 | **Request**
44 |
45 | GET v1/users/173/friends
46 |
47 | **Return** __shortened for example purpose__
48 | ```
49 | {
50 | "friends_count": 37,
51 | "friends_pages": 2,
52 | "page": 1,
53 | "friends": [
54 | {
55 | "id": 457180,
56 | "username": "mgcirillo",
57 | "firstname": "Mike",
58 | "lastname": "Cirillo",
59 | "city": "Toronto",
60 | "country": "Canada",
61 | "fullname": "Mike Cirillo",
62 | "userpic_url": "http://acdn.500px.net/457180/bcbec7f69f5275d5ecf189bc05f07ab2560b2b22/1.jpg?0",
63 | "upgrade_status": 2
64 | },
65 | {
66 | "id": 48920,
67 | "username": "EvgueniTchebotarev",
68 | "firstname": "Evgueni",
69 | "lastname": "Tchebotarev",
70 | "city": "Toronto",
71 | "country": "Canada",
72 | "fullname": "Evgueni Tchebotarev",
73 | "userpic_url": "http://acdn.500px.net/48920.jpg",
74 | "upgrade_status": 0
75 | },
76 | {
77 | "id": 12150,
78 | "username": "MaksimPo",
79 | "firstname": "Maksim",
80 | "lastname": "p.",
81 | "city": "tallinn",
82 | "country": "estonia",
83 | "fullname": "Maksim p.",
84 | "userpic_url": "http://external.ak.fbcdn.net/safe_image.php?d=47fb0c08b05d512cf1afaa8866774b39&url=http%3A%2F%2Fprofile.ak.fbcdn.net%2Fhprofile-ak-snc4%2F41765_100000921361830_4251_n.jpg&logo&v=5",
85 | "upgrade_status": 0
86 | }
87 | ]
88 | }
89 | ```
90 |
91 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
92 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
--------------------------------------------------------------------------------
/endpoints/user/GET_users_search.md:
--------------------------------------------------------------------------------
1 | # User Resources
2 |
3 | GET users/search
4 |
5 | ## Description
6 | Return listing of ten (up to one hundred) users from search results for a specified search term.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | * A valid Consumer Key must be provided in **consumer_key** parameter.
12 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
13 |
14 | ***
15 |
16 | ## Parameters
17 | - **term** _(required)_ — A keyword to search for.
18 |
19 | ***
20 |
21 | ## Return format
22 | An array with the following keys and values:
23 |
24 | - **current_page** — Number of the page that is returned.
25 | - **total_pages** — Total number of pages in this feature's stream.
26 | - **total_items** — Total number of items in this feature's stream.
27 | - **users** — An array of Users objects in **[full format][]**.
28 |
29 | ***
30 |
31 | ## Errors
32 | - **400 Bad Request** — The request issued is missing one or more of the required parameters or contains parameters in an invalid form.
33 |
34 | ***
35 |
36 | ## Example
37 | **Request**
38 |
39 | GET v1/photos/search?term=vovko
40 |
41 | **Return**
42 | ``` json
43 | {
44 | "current_page": 1,
45 | "total_pages": 1,
46 | "total_items": 1,
47 | "users": [
48 | {
49 | "id": 173,
50 | "username": "vovko",
51 | "firstname": "Vladimir",
52 | "lastname": "Drizhepolov",
53 | "birthday": null,
54 | "sex": 1,
55 | "city": "Toronto",
56 | "state": "Ontario",
57 | "country": "Canada",
58 | "registration_date": "2009-11-08T12:41:14-05:00",
59 | "about": "Toronto based photographer.\r\n",
60 | "domain": "vovko.500px.com",
61 | "fotomoto_on": true,
62 | "locale": "en",
63 | "show_nude": true,
64 | "fullname": "Vladimir Drizhepolov",
65 | "userpic_url": "http://acdn.500px.net/173.jpg",
66 | "upgrade_status": 2,
67 | "store_on": true,
68 | "contacts": {
69 | "website": "vovko.ca",
70 | "twitter": "vovko",
71 | "flickr": "Vladimir Drizhepolov",
72 | "gtalk": "vladimir@drizhepolov.com",
73 | "facebook": "562874260",
74 | "blog": "www.vovko.ca"
75 | },
76 | "equipment": {
77 | "camera": [
78 | "Kiev 88"
79 | ],
80 | "lens": [
81 | "Volna 80mm"
82 | ]
83 | },
84 | "photos_count": 17,
85 | "affection": 4,
86 | "friends_count": 86,
87 | "followers_count": 18,
88 | "following": false
89 | }
90 | ]
91 | }
92 | ```
93 |
94 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
95 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format
96 |
--------------------------------------------------------------------------------
/endpoints/user/GET_users_show.md:
--------------------------------------------------------------------------------
1 | # User Resources
2 |
3 | GET users/show
4 |
5 | ## Description
6 | Returns the profile information for a specified user.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | * A valid Consumer Key must be provided in **consumer_key** parameter.
12 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
13 |
14 | ***
15 |
16 | ## Parameters
17 | (required) One of the unique user identifiers:
18 |
19 | - **id** — Return information for the specified user ID.
20 | - **username** — Return information for the user with the specified username.
21 | - **email** — Return information for the user with the specified email address.
22 |
23 | ***
24 |
25 | ## Return format
26 | User profile information in **[full format][]**.
27 |
28 | Additional data:
29 | - **following** — (OAuth only) whether the currently authenticated user is following the user specified by the identifier, boolean.
30 |
31 | ***
32 |
33 | ## Errors
34 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error. Some results also include 'lookup_method' key specifying the parameter that was used for user lookup.
35 |
36 | - **400 Bad Request** — Request did not contain one of the required parameters.
37 | - **403 Forbidden** — The user requested has been disabled.
38 | - **404 Not Found** — User does not exist in our database.
39 |
40 | ***
41 |
42 | ## Example
43 | **Request (Using OAuth)**
44 |
45 | GET v1/users/show?username=freeatnet
46 |
47 | **Return**
48 | ``` json
49 | {
50 | "user": {
51 | "id": 3798,
52 | "username": "freeatnet",
53 | "firstname": "Arseniy",
54 | "lastname": "Ivanov",
55 | "birthday": null,
56 | "sex": 1,
57 | "city": "Toronto",
58 | "state": "Ontario",
59 | "country": "Canada",
60 | "registration_date": "2009-12-15T09:40:45-05:00",
61 | "about": "Your local web-developer guy. Casual photographer.",
62 | "domain": "freeatnet.500px.com",
63 | "fotomoto_on": true,
64 | "locale": "en",
65 | "show_nude": true,
66 | "fullname": "Arseniy Ivanov",
67 | "userpic_url": "/graphics/userpic.png",
68 | "upgrade_status": 2,
69 | "store_on": true,
70 | "contacts": {
71 | "website": "freeatnet.com",
72 | "twitter": "freeatnet_en",
73 | "facebookpage": "www.facebook.com/av.ivanov",
74 | "flickr": "freeatnet",
75 | "facebook": "769184274"
76 | },
77 | "equipment": {
78 | "camera": [
79 | "FUJIFILM FinePix S1000",
80 | "Canon EOS 50"
81 | ],
82 | "misc": [
83 | "Google Nexus S",
84 | "Apple Macbook Pro 15\""
85 | ]
86 | },
87 | "photos_count": 12,
88 | "galleries_count": 5,
89 | "affection": 20,
90 | "friends_count": 57,
91 | "followers_count": 77,
92 | "following": false
93 | }
94 | }
95 | ```
96 |
97 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
98 | [full format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#full-format
99 |
--------------------------------------------------------------------------------
/endpoints/user/POST_users_id_friends.md:
--------------------------------------------------------------------------------
1 | # User Resources
2 |
3 | POST users/:id/friends
4 |
5 | ## Description
6 | Add the user to the list of followers.
7 |
8 | ***
9 |
10 | ## Requires authentication
11 | * A valid Consumer Key must be provided in **consumer_key** parameter.
12 | * Alternatively, a valid **[OAuth][]** request with an authorized Access Token will be accepted.
13 |
14 | ***
15 |
16 | ## Parameters
17 |
18 | - **id** _(required)_ — ID of the User to add to the followers list.
19 |
20 | ***
21 |
22 | ## Return format
23 | A JSON array with followed User object.
24 |
25 | ***
26 |
27 | ## Errors
28 | All known errors cause the resource to return HTTP error code header together with a JSON array containing at least 'status' and 'error' keys describing the source of error.
29 |
30 | - **403 Forbidden** — The user requested has been disabled or already in followers list.
31 | - **404 Not Found** — User does not exist in our database.
32 |
33 | ***
34 |
35 | ## Example
36 | **Request**
37 |
38 | POST v1/users/827595/friends
39 |
40 | **Return**
41 | ``` json
42 | {
43 | user: {
44 | id: 827595,
45 | username: "voldemarpetruskauskus",
46 | firstname: "Voldemar",
47 | lastname: "Petruskauskus",
48 | birthday: null,
49 | sex: 0,
50 | city: "",
51 | state: "",
52 | country: "",
53 | registration_date: "2012-05-15T11:19:42-04:00",
54 | about: "Voldemar",
55 | domain: null,
56 | upgrade_status: 9,
57 | fotomoto_on: false,
58 | locale: "en",
59 | show_nude: false,
60 | store_on: false,
61 | contacts: { },
62 | equipment: { }
63 | }
64 | }
65 | ```
66 |
67 | [OAuth]: https://github.com/500px/api-documentation/tree/master/authentication
68 | [short format]: https://github.com/500px/api-documentation/blob/master/basics/formats_and_terms.md#short-format-1
--------------------------------------------------------------------------------
/examples/PHP/PHP.md:
--------------------------------------------------------------------------------
1 | # PHP
2 |
3 | There is an extensive wiki on of OAuth and xAuth authentication over at [oauth-php-wiki][] on Google Code. 500px.com oAuth is actually quite similar to Twitter's. Appropriating [@abraham's][] [TwitterOAuth][] library will give you a head start.
4 |
5 | In lib/TwitterOAuth.php
make the following adjustments:
6 |
7 | $host = 'https://api.500px.com/v1/';
8 |
9 | And set up the URLs:
10 |
11 | /* Set API URLS */
12 | function accessTokenURL() { return 'https://api.500px.com/v1/oauth/access_token'; }
13 | function authenticateURL() { return 'https://api.500px.com/v1/oauth/authorize'; }
14 | function authorizeURL() { return 'https://api.500px.com/v1/oauth/authorize'; }
15 | function requestTokenURL() { return 'https://api.500px.com/v1/oauth/request_token'; }
16 |
17 | Change the example index.php from:
18 |
19 | /* If method is set change API call made. Test is called by default. */
20 | #$content = $connection->get('account/verify_credentials');
21 |
22 | To:
23 |
24 | /* Retrieve all photos in category Journalism that were uploaded today */
25 | $content = $connection->get('photos', array('feature' => 'fresh_today', 'only' => 'Journalism'));
26 |
27 | [oauth-php-wiki]: http://example.com/ "OAuth - Consumer and Server library for PHP"
28 | [@abraham's]: http://twitter.com/abraham "@abraham"
29 | [twitteroauth]: https://github.com/abraham/twitteroauth "TwitterOAuth"
30 |
--------------------------------------------------------------------------------
/examples/Ruby/xauth.rb:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 | require 'oauth'
3 | require 'multi_json'
4 |
5 | CONSUMER_KEY = ''
6 | CONSUMER_SECRET = ''
7 | USERNAME = ''
8 | PASSWORD = ''
9 |
10 | BASE_URL = 'https://api.500px.com'
11 |
12 | def get_access_token
13 | p "get_access_token: Initializing Consumer"
14 | consumer = OAuth::Consumer.new(CONSUMER_KEY, CONSUMER_SECRET, {
15 | :site => BASE_URL,
16 | :request_token_path => "/v1/oauth/request_token",
17 | :access_token_path => "/v1/oauth/access_token",
18 | :authorize_path => "/v1/oauth/authorize"})
19 |
20 | request_token = consumer.get_request_token()
21 | p "Request URL: #{request_token.authorize_url}"
22 | access_token = consumer.get_access_token(request_token, {}, { :x_auth_mode => 'client_auth', :x_auth_username => USERNAME, :x_auth_password => PASSWORD })
23 | access_token
24 | end
25 |
26 | access_token = get_access_token
27 | p "token: #{access_token.token}"
28 | p "secret: #{access_token.secret}"
29 |
30 |
31 | #p access_token.get('/v1/photos.json').body
32 | p MultiJson.decode(access_token.get('/v1/users.json').body).inspect
--------------------------------------------------------------------------------
/examples/iOS/API Tutorials.md:
--------------------------------------------------------------------------------
1 | # 500px API Tutorial
2 |
3 | Hello astronauts, war heroes, Olympians - you're here because we want the best, and you are it. So: Who is ready to make some great apps?
4 |
5 | ## Specifics
6 |
7 | 500px API requests are RESTful and return JSON. **All** 500px API requests are conducted over HTTPS. There are two ways to sign requests: Consumer Key and OAuth. Consumer Key-signed requests are ones that aren't specific to a logged-in user. For instance, getting a list of popular photos only requires the Consumer Key authentication. However, liking a photo requires a user to be logged in; these types of requests must be signed with OAuth.
8 |
9 | There are some requests which can be signed with either a Consumer Key or OAuth. In these cases, additional information is returned if the request is signed with OAuth. This information is specific to the currently logged-in user; for example, whether or not a user has liked a photo or is following a specific user.
10 |
11 | ## Signing Requests with your Consumer Key
12 |
13 | To sign a request with your consumer key, all you have to do append `consumer_key=YOUR_CONSUMER_KEY_HERE` to the query string of the request. So a request to look at the second page of editor's choice would look `https://api.500px.com/v1/photos?feature=editors&page=2&consumer_key=YOUR_CONSUMER_KEY_HERE`.
14 |
15 | ## Signing Requests with OAuth
16 |
17 | Signing requests with OAuth is, unsurprisingly, more complicated. First off, you'll need to authenticate your user.
18 |
19 | ### Three-Legged OAuth Authentication
20 |
21 | The three-legged OAuth authentication with the 500px API is straightforward and uses standard OAuth workflow. Any one of available libraries for your platform should work. If you want to roll your own, the instructions below on two-legged OAuth should get you going.
22 |
23 | ### Two-Legged OAuth Authentication
24 |
25 | Two-legged OAuth authentication, sometimes referred to as XAuth, is also possible if we enabled it on your account. Just ask nicely :)
26 |
27 | 1. ### Obtain a request token.
28 |
29 | Make a POST request to `https://api.500px.com/v1/oauth/request_token`. Set the HTTP header "Authorization" to the same URL. You should receive back a 200 response code and a string like the following.
30 | > oauth_token=TOKEN_HERE&oauth_token_secret=SECRET_HERE&oauth_callback_confirmed=true
31 | Extract these out for the next step.
32 |
33 | 2. ### Obtain Access Token
34 |
35 | Make a POST request to `https://api.500px.com/v1/oauth/access_token`. You'll need to set the POST body to be a querey string containing `x_auth_mode` set to "client_auth" and `x_auth_password` and `x_auth_username` set to URL-encoded username and password with which you're trying to authenticate. These keys/value pairs must be lexicographically sorted by key name. In Objective-C, this looks something like the following:
36 |
37 | NSArray * parameterArray = [NSArray arrayWithObjects:
38 | [NSString stringWithFormat:@"%@=%@", @"x_auth_mode", @"client_auth"],
39 | [NSString stringWithFormat:@"%@=%@", @"x_auth_password", [thePassword urlEncode]],
40 | [NSString stringWithFormat:@"%@=%@", @"x_auth_username", [theUserName urlEncode]], nil];
41 | [postRequest setHTTPBody:[[parameterArray componentsJoinedByString:@"&"] dataUsingEncoding:NSUTF8StringEncoding]];
42 |
43 | This is the easy part. Now we need to set the `Authorization` HTTP header. We use the `oauth_nonce`, `oauth_signature_method`, `oauth_timestamp`, `oauth_consumer_key`, `oauth_token`, `oauth_signature`, and `oauth_version` parameters to construct the OAuth `Authorization` field value. The order of these is again **very important** since they are lexicographically sorted by key name. In Objective-C, it is constructed as follows:
44 |
45 | NSArray * keysAndValues = [NSArray arrayWithObjects:
46 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_nonce", [self.nonce urlEncode]],
47 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_signature_method", [@"HMAC-SHA1" urlEncode]],
48 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_timestamp", [self.timestamp urlEncode]],
49 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_consumer_key", [kConsumerKey urlEncode]],
50 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_token", [theRequestToken urlEncode]],
51 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_signature", [SIGNATURE_HERE urlEncode]],
52 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_version", [[NSString stringWithString:@"1.0"] urlEncode]],
53 | nil];
54 |
55 | [postRequest addValue:[NSString stringWithFormat:@"OAuth %@", [keysAndValues componentsJoinedByString:@", "] forHTTPHeaderField:@"Authorization"];
56 |
57 | One of the key/value pairs we use here is the signature used by OAuth. *This uses a different base string than the one used to sign normal OAuth requests*. This special base string is constructed and then encrypted using HMAC-SHA1.
58 |
59 | Append your request secret to you Consumer Secret, separated by an apersand, and encode it with UTF8. Construct your base string (see below) and encode it with UTF8 as well, and then generate the signature. In Objective-C, a method to generate this might look like the following:
60 |
61 | NSString * secret = [NSString stringWithFormat:@"%@&%@", YOUR_CONSUMER_KEY_HERE, theRequestSecret];
62 |
63 | NSData * secretData = [secret dataUsingEncoding:NSUTF8StringEncoding];
64 | NSData * baseData = [BASE_STRING_HERE dataUsingEncoding:NSUTF8StringEncoding];
65 |
66 | uint8_t digest[20] = {0};
67 | CCHmac(kCCHmacAlgSHA1, secretData.bytes, secretData.length,
68 | baseData.bytes, baseData.length, digest);
69 |
70 | NSData * signatureData = [NSData dataWithBytes:digest length:20];
71 | return [signatureData base64EncodedString];
72 |
73 | Lastly, we'll need to construct the base string used to create the signature. This is farily straightforward but is a little quirky. Constructing the base string in Objective-C would look like the following:
74 |
75 | NSString * url = [theURL urlEncode]; //this is the URL we're calling, should be https://api.500px.com/v1/oauth/access_token
76 |
77 | NSString * parameters;
78 |
79 | NSString * oauth_consumer_key = [YOUR_CONSUMER_KEY urlEncode];
80 | NSString * oauth_nonce = [self.nonce urlEncode];
81 | NSString * oauth_signature_method = [[NSString stringWithString:@"HMAC-SHA1"] urlEncode];
82 | NSString * oauth_timestamp = [self.timestamp urlEncode];
83 | NSString * oauth_version = [[NSString stringWithString:@"1.0"] urlEncode];
84 | NSString * x_auth_mode = [@"client_auth" urlEncode];
85 | NSString * x_auth_password = [[thePassword urlEncode] urlEncode]; //These are double-encoded on purpose
86 | NSString * x_auth_username = [[theUserName urlEncode] urlEncode];
87 |
88 | NSArray * params = [NSArray arrayWithObjects:
89 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_consumer_key", oauth_consumer_key],
90 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_nonce", oauth_nonce],
91 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_signature_method", oauth_signature_method],
92 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_timestamp", oauth_timestamp],
93 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_token", theRequestToken],
94 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_version", oauth_version],
95 | nil];
96 |
97 | params = [params arrayByAddingObjectsFromArray:[NSArray arrayWithObjects:[NSString stringWithFormat:@"%@%%3D%@", @"x_auth_mode", x_auth_mode],
98 | [NSString stringWithFormat:@"%@%%3D%@", @"x_auth_password", x_auth_password],
99 | [NSString stringWithFormat:@"%@%%3D%@", @"x_auth_username", x_auth_username], nil]];
100 | //sort paramaters lexicographically
101 | params = [params sortedArrayUsingSelector:@selector(compare:)];
102 |
103 | parameters = [params componentsJoinedByString:@"%26"];
104 |
105 | NSArray * baseComponents = [NSArray arrayWithObjects:
106 | theHTTPMethod,
107 | url,
108 | parameters,
109 | nil];
110 | NSString * baseString = [baseComponents componentsJoinedByString:@"&"];
111 |
112 | And that's it. If all goes well, you should get back a 200 response code with a response body resembling `oauth_token=THE_TOKEN&oauth_token_secret=THE_SECRET`. Of course, things don't always go well. You may receive a 403 if the user enters invalid credentials; you can also get "`Invalid OAuth Request`" if something is wrong with your signing code.
113 |
114 | ## Signing Requests
115 |
116 | At a high-level, signing requests is just adding a special value for the `Authorization` HTTP header field. The POST request looks something like this:
117 |
118 | 
119 |
120 | The process to create this request is represented in the following flow chart.
121 |
122 | 
123 |
124 | Signing requests with OAuth involves creating a special value for the `Authorization` HTTP header field. Creating that header value requires the HTTP method (POST, GET, or DELETE), the POST or GET parameters you're sending, and the token/secret combination you obtained when the user was authenticated (above).
125 |
126 | The value of the `Authorization` HTTP header field is:
127 |
128 | OAuth SORTED_KEY_VALUE_PAIRS_HERE.
129 |
130 | The list of key/value pairs are sorted lexicographically and include `oauth_none`, `outh_signature_method`, `oauth_timestamp`, `oauth_consumer_key`, `oauth_token`, `oauth_signature`, and `oauth_version`. In Objective-C, a method to create this string would resmble the following:
131 |
132 | NSArray * keysAndValues = [NSArray arrayWithObjects:
133 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_consumer_key", [kConsumerKey urlEncode]],
134 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_nonce", [self.nonce urlEncode]],
135 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_signature", [YOUR_SIGNATURE_HERE urlEncode]],
136 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_signature_method", [[NSString stringWithString:@"HMAC-SHA1"] urlEncode]],
137 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_timestamp", [self.timestamp urlEncode]],
138 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_token", [theToken urlEncode]],
139 |
140 | [NSString stringWithFormat:@"%@=\"%@\"", @"oauth_version", [[NSString stringWithString:@"1.0"] urlEncode]], nil];
141 |
142 | return [NSString stringWithFormat:@"OAuth %@", [keysAndValues componentsJoinedByString:@", "]];
143 |
144 | You'll need to construct a signature for this request. This is a **different but similar** signature than the one used in authentication. The signature is encrypted using the consumer secret and access secret using HMAC-SHA1. An Objective-C method to encrypt a base string, yielding a signature, would look like the following:
145 |
146 | NSString * secret = [NSString stringWithFormat:@"%@&%@", kConsumerSecret, theSecret];
147 |
148 | NSData * secretData = [secret dataUsingEncoding:NSUTF8StringEncoding];
149 | NSData * baseData = [YOUR_BASE_STRING_HERE dataUsingEncoding:NSUTF8StringEncoding];
150 |
151 | uint8_t digest[20] = {0};
152 | CCHmac(kCCHmacAlgSHA1, secretData.bytes, secretData.length,
153 | baseData.bytes, baseData.length, digest);
154 |
155 | NSData * signatureData = [NSData dataWithBytes:digest length:20];
156 | return [signatureData base64EncodedString];
157 |
158 | The base string, similar but different to the one used in authentication, is constructed by concatenating the sorted list of `oauth_consumer_key`, `oauth_nonce`, `oauth_signature_method`, `oauth_timestamp`, `oauth_token`, and `oauth_version`, as well as any POST or GET parameters. The keys and values of the POST or GET parameters, in addition to the values for the OAuth parameters, must be URL-encoded. An Objective-C method to construct the base string would look like the following:
159 |
160 | NSString * url = [theURL urlEncode];
161 |
162 | NSString * parameters;
163 |
164 | NSString * oauth_consumer_key = [kConsumerKey urlEncode];
165 | NSString * oauth_nonce = [self.nonce urlEncode];
166 | NSString * oauth_signature_method = [[NSString stringWithString:@"HMAC-SHA1"] urlEncode];
167 | NSString * oauth_timestamp = [self.timestamp urlEncode];
168 | NSString * oauth_version = [[NSString stringWithString:@"1.0"] urlEncode];
169 |
170 | NSArray * params = [NSArray arrayWithObjects:
171 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_consumer_key", oauth_consumer_key],
172 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_nonce", oauth_nonce],
173 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_signature_method", oauth_signature_method],
174 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_timestamp", oauth_timestamp],
175 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_token", theToken],
176 | [NSString stringWithFormat:@"%@%%3D%@", @"oauth_version", oauth_version],
177 | nil];
178 | NSArray *keys = [theOptions allKeys];
179 | for (id key in keys)
180 | {
181 | params = [params arrayByAddingObject:[[NSString stringWithFormat:@"%@=%@", [key urlEncode], [[theOptions valueForKey:key] urlEncode]] urlEncode]];
182 | }
183 |
184 | //sort paramaters lexicographically
185 | params = [params sortedArrayUsingSelector:@selector(compare:)];
186 |
187 | parameters = [params componentsJoinedByString:@"%26"];
188 |
189 | NSArray * baseComponents = [NSArray arrayWithObjects:
190 | theHTTPMethod,
191 | url, //The URL you're requesting, *not* including any GET parameters
192 | parameters,
193 | nil];
194 | NSString * baseString = [baseComponents componentsJoinedByString:@"&"];
195 |
196 | ### POST
197 |
198 | POST parameters need to have their key and value individually URL-encoded. Sort the parameters list lexicographically and concatenate them as a query string, separated by ampersands, and encode the string with UTF8 as the POST HTTP body.
199 |
200 | ### GET
201 |
202 | GET parameters are added to the end of URLs. They should not be URL-encoded, but *do* need to be lexicographically sorted.
203 |
204 | ### DELETE
205 |
206 | Whenever you want to DELETE an item, send a POST request instead with `_method` parameter set to "`delete`".
207 |
208 | ## Photo Streams
209 |
210 | Photo streams include Popular, Editor's Choice, Upcoming, Fresh (variants include today, yesterday, and this week), a user's feed, and a user's friend feed.
211 |
212 | Photo Streams are a GET request that can be signed either with your Consumer Key or OAuth. If you sign with OAuth, the response will indicate if the currently logged in user has voted for each photo.
213 |
214 | Specifying specific users (`user` or `user_friends` features) requires either specifying a `user_id` or `username` parameter.
215 |
216 | Photo streams can be sorted into only displaying one category, excluding a category, and sorting the results. You can specify a pagination values for page number and results per page. Excluding categories with spaces, like "Black and White" uses the string "Black+and+White" as a value for the `exclude` key.
217 |
218 | Photo streams return a JSON dictionary containing the current page, the feature, any filters, the total number of items in the feed, and the total pages in the feed (using the same results per page as specified in the request). Finally, there is an array called `photos` that contains the photos in the stream in short-form (see below).
219 |
220 | Optionally, you may specify an `image_size` parameter to specify the size of the thumbnail contained in each short-form photo model.
221 |
222 |
223 | image_size Thumbnail Sizes
224 | 1 70 x 70
225 | 2 140 x 140
226 | 3 280 x 280
227 | 4 900 wide or 900 tall, max
228 |
229 |
230 | Please specify an `image_size` that is appropriate for your app; it will help your user experience and reduce our bandwidth costs! If the photographer has uploaded a smaller image to 500px, then we do *not* scale that image up to 900px.
231 |
232 | ## Search
233 |
234 | The search API currently only searches *photos*, not *users*. You can specify either a search `term` or `tag` (exactly one is required). You can also specify pagination information which includes the page number and results per page.
235 |
236 | Returned JSON is in the same format as the photo stream response.
237 |
238 | ## Specific Photo Details
239 |
240 | This endpoint returns a long-form photo model and a `comments` array. You can specify pagination data for the comments with `comments_page` (comment pages always contain 20 comments or fewer).
241 |
242 | ## Liking Photos
243 |
244 | Our API only allows users to vote *for* photos; it doesn't allow them to downvote.
245 |
246 | To like a photo, POST to the `photos/PHOTO_ID/vote` endpoint with the parameter `vote` set to `1`. This method **must** be signed with OAuth.
247 |
248 | To undo a like on a photo, DELETE to the `photos/PHOTO_ID/vote` endpoint. This method **must** be signed with OAuth.
249 |
250 | Your response includes, in part, a short-form photo model; this model's rating has been updated to reflect your user's like (or unlike).
251 |
252 | ### Following/Unfollowing Users
253 |
254 | To follow or unfollow a user, either POST or DELETE to the `users/USER_ID/friends` endpoint. You can only do this for the currently logged-in user. If the response code is non-200, an `error` key/value pair will specify what went wrong. Common `error` values are "Already following" and "Your're following too many users". Currently, the number of users you can follow is capped to ~4000.
255 |
256 | ## Uploading Photos
257 |
258 | To upload a photo, you need to create the photo entity first with an OAuth-signed POST request to the [`photos`](http://developers.500px.com/docs/photos-post) endpoint. Thise requires a name, description, and category number (there are some additional, optional parameters). A successful response shoudl return a 200 response code and a JSON dictionary with an `upload_key` and short-form photo model. Parse out the model's `id`; we'll need it for later.
259 |
260 | To upload a photo, you'll need to create an HTTP multipart form request. This request is *not* signed with OAuth, but is authenticated using the `upload_key` we received earlier. POST to the [`upload`](http://developers.500px.com/docs/upload-post) endpoint with the following parmeters: your consumer key, the `photo_id`, the currently logged-in user's OAuth token, the `upload_key`, and a filename (if your image exists only in memory, this can be anything as long as it has a `.jpg` extension).
261 |
262 | Creating a multi-part form request can sometimes be difficult, depending on your framework. Creating a valid upload request with an in-memory UIImage instance in Objective-C could be done with the following code.
263 |
264 | NSDictionary *postKeys = [NSDictionary dictionaryWithObjects:
265 | [NSArray arrayWithObjects:
266 | YOUR_CONSUMER_KEY_HERE,
267 | USER_OAUTH_TOKEN_HERE,
268 | uploadKey,
269 | photoID,
270 | @"1.jpg", nil]
271 | forKeys:
272 | [NSArray arrayWithObjects:
273 | @"consumer_key",
274 | @"access_key",
275 | @"upload_key",
276 | @"photo_id",
277 | @"filename", nil]];
278 |
279 | NSURL *uploadPhotoURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.500px.com/upload?consumer_key=%@", YOUR_CONSUMER_KEY_HERE]];
280 | NSMutableURLRequest *uploadPhotoRequest = [NSMutableURLRequest uploadPhotoURL];
281 | [uploadPhotoRequest setHTTPMethod:@"POST"];
282 | NSString *stringBoundary = [NSString stringWithString:@"0xKhTmLbOuNdArY"];//a valid boundary
283 | NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",stringBoundary];
284 | [uploadPhotoRequest setValue:contentType forHTTPHeaderField:@"Content-Type"];
285 |
286 | NSMutableData *postBody = [NSMutableData data];
287 | [postBody appendData:[[NSString stringWithFormat:@"--%@\r\n",stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
288 |
289 | NSEnumerator *keys = [postKeys keyEnumerator];
290 | NSInteger i;
291 | for (i = 0; i < [postKeys count]; i++) {
292 | NSString *tempKey = [keys nextObject];
293 | [postBody appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n",tempKey] dataUsingEncoding:NSUTF8StringEncoding]];
294 | [postBody appendData:[[NSString stringWithFormat:@"%@",[postKeys objectForKey:tempKey]] dataUsingEncoding:NSUTF8StringEncoding]];
295 | [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
296 | }
297 |
298 | [postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"file\"; filename=\"1.jpg\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
299 | [postBody appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
300 | NSData *photoData = UIImageJPEGRepresentation(photoModel.image, 1);//[[NSString stringWithFormat:@"%@",[UIImageJPEGRepresentation(UIIMAGE_INSTANCE_HERE, 1) base64EncodedString]] dataUsingEncoding:NSUTF8StringEncoding];
301 | [postBody appendData:photoData];
302 | [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
303 | [uploadPhotoRequest setHTTPBody:postBody];
304 |
305 | ## Parsing JSON
306 |
307 | Please note that, unless otherwise stated, any "optional" fields can be `null` (instead of being absent from the JSON altogether). This can cause parsing issues, so please check for `null` values when parsing the JSON into your data models.
308 |
309 | ## Short-Form Photos
310 | Short-form photos contain the category, photo ID, a thumbnail URL, photo name, rating, a user in short-form (below) and number of votes. If the photo request was signed with OAuth, it also contains information if the currently logged-in user has voted for the photo.
311 |
312 | ## Long-Form Photos
313 | Long-form photos are a containing a photo's description(`body`), upload date (`created_at`), photo ID, latitude and longitude (both `null` if not present), title, a short-form user model, any tags the photo has, and the short-form photo model.
314 |
315 | ## Short-Form Users
316 | A short-form user model is contained in a photo model, either short or long-form. It contains a user's first name, last name, full name, User ID, "Awesome" status, their user display name, and their avatar image URL.
317 |
318 | ## Long-Form Users
319 | Long-form user models contain a user bio (`about`), affection, birthday, city, state, country, a contacts dictionary (listing any specified contacts, noted below), a 500px domain, first name, last name, full name, number of followers, user ID, any equipment, number of photos on 500px, registration date, gender, "Awesome" status, user display name, and user avatar image URL.
320 |
321 | The contacts dictionary lists any contact information the user has specified in their 500px profile. It can include the following. (Note that if a contact method isn't supplied, it's not present in the `contacts` dictionary at all.)
322 |
323 |
324 | Contact Type Dictionary Key
325 | Facebook facebook
326 | Twitter twitter
327 | Google+ googleplus
328 | Personal Website website
329 | Personal Blog blog
330 | Flickr flickr
331 | Live Journal livejournal
332 | Skype skype
333 | Google Talk googletalk
334 | Tumblr tumblr
335 |
336 |
337 | The `equipment` dictionary contains three key/value pairs: `lens`, `camera`, and `misc`. Each one is an array of the user's lenses, cameras, amd other equipment, respectively.
338 |
339 | If the request that returned the long-form user model was signed with OAuth, the user mode also contains the `following` key whose boolean value represents whether or not the currently logged-in user is following this user.
340 |
341 | ## Awesome Status
342 | Short- and Long-Form User models contain the `upgrade_status` key that specifies their "Awesome" status on 500px. This is an integer which is typically 0, 1, or 2. Anything other than 0 specifies and "Awesome" user and anything you can do to make them feel more special would make you awesome, too!
343 |
--------------------------------------------------------------------------------
/examples/iOS/oauth_flowchart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/500px/legacy-api-documentation/b1e82745e45f944f8261ad51656cf511e27c0692/examples/iOS/oauth_flowchart.png
--------------------------------------------------------------------------------
/examples/iOS/oauth_post.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/500px/legacy-api-documentation/b1e82745e45f944f8261ad51656cf511e27c0692/examples/iOS/oauth_post.png
--------------------------------------------------------------------------------