| Members: 14 |
| Language: English |
|
Group categories:
|
| More group info » |
IntroductionThis document details the ScrnShots.com public API. The API is available to any developer who wishes to create a tool that interfaces with ScrnShots.com through its upload/storage API and its related APIs. Document & API StateCurrently, we are still working on the full API for ScrnShots.com. However, any API methods that are documented within this document will be considered to be stable and will be supported in the future by ScrnShots. Restful ResourcesThe ScrnShots API conforms to REST (Representational State Transfer) as much as possible. It uses the HTTP verbs through unique resource URIs to act on them. AuthenticationCurrently, ScrnShots implements HTTP Basic Authentication for actions that require authentication (marked in API docs). To perform actions that require authentication use the ScrnShots username and password via HTTP Basic Auth. A more secure method of authentication is planned, but not ready to be released at the time of this writing.
On all requests that require authentication, if the user is does authenticate you will get a 401 Response with the following string: Could't authenticate you Screenshot RSS Feeds
Although they are not entirely documented here yet, most pages (currently excluding search pages) that list screenshots include an RSS feed. To access the feed, simply add ".rss" to the end of the URL. Screenshot MethodsUpload a Screenshot (Authentication Required)
Uploads a screenshot to the system with the passed in parameters URL: http://www.scrnshots.com/screenshots.xml HTTP Method: POST Format: XML Paramaters:
Example cURL Post: Here is an example of posting a screenshot using the command line tool cURL (This is should all be one line but is broken with '\' to make it easier to read): curl http://www.scrnshots.com/screenshot.xml -H 'Accept: application/xml' \ -F 'screenshot[uploaded_data]=@/path-to-image;type=image/png' \ -F 'screenshot[description]=This is a really great screenshot' \ -F 'screenshot[tag_list]=blue design form_design' \ -F 'screenshot[source_url]=www.scrnshots.com' \ -u my-scrnshots-username:my-scrnshots-password --basic
Example Success Response: If the screenshot upload was successful it will return the screenshot as xml:
<screenshot> <tag href="http://www.scrnshots.com/users/my-scrnshots-username/tags/design">design</tag> <tag href="http://www.scrnshots.com/users/my-scrnshots-username/tags/form_design">form_design</tag> </tags> Example Error Response: Otherwise, it will return error messages as XML: <?xml version="1.0" encoding="UTF-8"?> The upload file must be smaller than 5mb and be of the type PNG, JPG or GIF. Errors will be returned if these are not met.
User MethodsGet User DetailsReturns the user's detailed information URL: http://www.scrnshots.com/users/{user_login}.{format} HTTP Method: GET Format: XML, JSON Paramaters: None Example XML Response: <user> <id>1</id> <login>login_name</login> <about-me>I am so great</about-me> <website>www.scrnshots.com</website> <avatars> <large>http://full-url.png</large> <medium>http://full-url.png</medium> <tiny>http://full-url.png</tiny> </avatars> </user>
Example JSON Response: {"user": {"id": 1, "login": "login_name", "about_me": "I am so great", "website": "www.scrnshots.com" }} User Contacts MethodsGet User's ContactsReturns the details of all the user's contacts. URL: http://www.scrnshots.com/users/{user_login}/contacts.{format} HTTP Method: GET Format: XML, JSON Paramaters: None Example XML Response: <contacts type="array">
Example JSON Response: [{"user": {"about_me": I am great, "website": http://www.my-website.com, "id": 2, "login": "scrnshots-user-name"}}] Get a User's TagsReturns all of the user's tags and the number of times they've used it. URL: http://www.scrnshots.com/users/{user_login}/tags.{format} HTTP Method: GET Format: XML Paramaters: None Example Response: <tags>
|
| ||||||||||||||||||||||||||||
| Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy |
| ©2009 Google |