APIs
Home  |  Documentation  |  Register an App  |  Your Apps  |  Login

Documentation
Be RESTful before reading this documentation!


Description
We use simple RESTful API architecture for uploading images and posting message to Twitter Right now we have only one method (UPLOAD). If you want to access the snaps click here
URL
http://twitsnaps.com/dev/image/upload.format
Available Formats
xml, json
HTTP Method
POST
Parameters
appKey : Your APP Key.
consumerKey : Your Twitter Consumer Key.
consumerSecret : Your Twitter Consumer Secret.
oauthToken : User's Twitter OAuth Token.
oauthSecret : User's Twitter OAuth Secret.
message : Description of the image.
media : The upload data (It can be a file binary data or URL of the image).
Responses
You can get error message or success message. The error messages contain an error code and a description of the error. The error codes are almost equivalent to HTTP status code.
Error Codes
203 : Malicious Content.
400 : Bad Request.
401 : Authentication Failed.
404 : Given format is not available.
405 : Invalid request method.
414 : File size is too long! We Support only 10MB.
415 : File type is invalid.
500 : Internal Server Problem.
Sample Error Message
XML
<?xml version="1.0" encoding="UTF-8"?>
<error>
    <code>405</code>
    <description>Invalid Request Method</url>
</error>
JSON
{
    "error" :
    {
        "code" : 405,
        "description" : Invalid Request Method
    }
}
Sample Success Message
XML
<?xml version="1.0" encoding="UTF-8"?>
<image>
    <id>1010</id>
    <url>http://twitsnaps.com/1010</url>
    <timestamp>Jun 16, 2010</timestamp>
    <user>
        <id>30196754</id>
        <screen_name>TwitSnaps</screen_name>
    </user>
</image>
JSON
{
    "image" :
    {
        "id" : 1010,
        "url" : http://twitsnaps.com/1010,
        "timestamp" : Jun 16, 2010,
        "user" :
        {
            "id" : 30196754,
            "username" : TwitSnaps
        }
    }
}
Paths of snaps/thumbnails etc
You should access the following urls to access the snaps files.
Mini Thumbnail
http://twitsnaps.com/mini/imageid
Thumbnail
http://twitsnaps.com/thumb/imageid
Full Snap
http://twitsnaps.com/snap/imageid

Twitsnaps is a business of MapXL Inc