Returns details about the user with the given ID.
HTTP response codes:
| Code | Description |
|---|---|
| 404 | No user with the specified ID exists |
| 200 | Success |
This document specifies the Zoopy REST API, and outlines how to call each of the methods offered by the API. If you are unsure how RESTful APIs work, you can start by having a look at Wikipedia. The API sits on http://api.zoopy.com, and the URLs listed below are relative to that host. You can send all feedback and any queries to api@zoopy.com.
This document was last updated at Thu, 26 Mar 2009 12:46:28 +0200
Methods in this API should be called as regular HTTP requests. The HTTP request method needed in each instance is specified in this document, and as mentioned in the introduction all URLs below are relative to http://api.zoopy.com. The values in parentheses indicate a variable. Accepted values will depend on the circumstance, but in general the following holds:
| Variable | Accepted values |
|---|---|
| format | 'xml' or 'json' |
| id | Any positive integer |
Each API request requires that your Zoopy username and password be sent. The API implements basic HTTP authentication. Failure to provide these credentials will result in a 401.
In line with the RESTful style, all methods in this API respond with meaningful HTTP codes. The response codes depend on the request, but the following response codes are returned by all methods:
| Code | Description |
|---|---|
| 401 | Authorization required. The API requires that your Zoopy username and password be supplied with each request. Basic HTTP authentication is used. |
| 404 | Not found. The requested method has not been implemented. |
| 501 | Not implemented. The requested format has not been implemented for this method. The HTTP request method has not been implemented for this method. |
| 500 | Internal server error. There has been an error generating a response the request. |
Each response will contain a flag to tell you whether or not the response is an error or the requested content. Below are what you can expect for errors/successes in both XML and JSON:
| XML | JSON | |
|---|---|---|
| Error | <result type="error"> <title>Not found</title> <message>The requested media item does not exist.</message> <httpCode>404</httpCode> </result> | {
"result":"error",
"content":{
"title":"Not found",
"message":"The requested media item does not exist.",
"httpCode":404
}
} |
| Success | <result type="success"> <media uri="http://api.zoopy.com/rest/media/1.xml"> <type>photo</type> <title><![CDATA[MCQP Laser Show]]></title> </media> </result> | {
"result":"success",
"content":{
"media":{
"uri":"http:\/\/api.zoopy.com\/rest\/media\/1.json",
"type":"photo",
"title":"MCQP Laser Show"
}
}
} |
Returns details about the user with the given ID.
| Code | Description |
|---|---|
| 404 | No user with the specified ID exists |
| 200 | Success |
Returns a paginated list of users that this user follows.
| Requirement | Name | Description | Default |
|---|---|---|---|
| optional | page | 1 | |
| optional | perPage | 10 |
| Code | Description |
|---|---|
| 404 | No user with the specified ID exists |
| 200 | Success |
Returns a paginated list of users that follow this user.
| Requirement | Name | Description | Default |
|---|---|---|---|
| optional | page | 1 | |
| optional | perPage | 10 |
| Code | Description |
|---|---|
| 404 | No user with the specified ID exists |
| 200 | Success |
Returns a paginated list of this user's media items.
| Requirement | Name | Description | Default |
|---|---|---|---|
| optional | page | 1 | |
| optional | perPage | 10 |
| Code | Description |
|---|---|
| 404 | No user with the specified ID exists |
| 200 | Success |
Searches media against supplied criteria and returns a paginated list of matching media.
| Requirement | Name | Description | Default |
|---|---|---|---|
| required | query | The search query to match against | |
| optional | order | How the results should be ordered, one of 'relevance', 'date' and 'views' | 'relevance' |
| optional | page | 1 | |
| optional | perPage | 10 |
| Code | Description |
|---|---|
| 400 | No search query specified or the ordering is invalid |
| 200 | Success |
Returns details about the media item with given ID.
| Code | Description |
|---|---|
| 404 | No media item with the specified ID exists |
| 401 | The media item is private and you are not the owner |
| 200 | Success |
Submits a file to be uploaded. The POST should be sent as multipart/form-data, in a similar way to how yourbrowser would submit a form with a file input. The file's parameter is called 'file'.
| Requirement | Name | Description | Default |
|---|---|---|---|
| required | file | See method description | |
| required | title | Title of the new media item, max. 255 characters | |
| optional | tags | Comma-separated list of tags, max. 255 characters | |
| optional | description | Description for the new media item, max. 65535 characters | |
| optional | privacy | 'private' or 'public' | 'public' |
| optional | license | Zoopy license ID, see http://api.zoopy.com/rest/licenses. | format |
| optional | comments | 'open', 'closed' or 'hidden' | 'open' |
| Code | Description |
|---|---|
| 406 | There is an error in the data submitted |
| 201 | The upload has been accepted (photos only) |
| 202 | The upload has been accepted for processing (videos and audio clips only) |
Returns the name of the tag with the given ID and a paginated list of media that are tagged with it.
| Requirement | Name | Description | Default |
|---|---|---|---|
| optional | page | 1 | |
| optional | perPage | 10 |
| Code | Description |
|---|---|
| 404 | No tag with the specified ID exists |
| 200 | Success |