API (REST) Documentation

Things All API Participants Should Know
Like Twitter, we use REST style API.
We currently have 1 call to upload and/or post to Twitter.
There is no API Key needed, just your IP Adress
At this time, there is no maximum on allowed API calls per IP.


Method: http://api.imj.tw/upload
Description: Upload an image to a specified account as well as the option to post such image to Twitter.
Requirement: Form must be multipart/form-data formatted/enabled.
All sent information is passed via the POST method. All GET method requests are ignored.
Parameters
Username (Required | Twitter Username)
Password (Required | Twitter Password)
Media (Required | Media Sent Via Binary Data)
Message (Optional | Status To Post To Twitter)

Sample OK Response

<res status="ok"> <userid>1</userid> <media_id>1</media_id> <media_url>http://imj.tw/1</media_url> <block_url>http://imj.tw/1/block</block_url> <thumbnail_url>http://imj.tw/1/thumbnail</thumbnail_url> </res>
Sample Error Response <res status="fail"> <error code="23">There was no file added.</error> </res>
Possible Reported Error Codes
#20 : Max amount of requests reached for this ip today. Try again later.
#21 : Twitter username or password is invalid.
#22 : File is too large.
#23 : There was no file added.
#24 : The file was not a .jpg .png or a .gif.

Showing/Grabbing Images
This does not actually require a true API implementation. To get an image of a certain size use:
http://imj.tw/[IMAGE-ID/SHORTURL]-[SIZE].[ANY-EXTENSION]
Since we are running on a system where extensions are determined via header, the extension does not matter, bearing in mind that it needs to be there. If you encounter any issues with this, feel free to contact us. Additionally here are the sizes for the corresponding urls:
Block  : block
Small  : small
Medium : medium
Large  : large
Preview: preview
Thumb  :Thumbnail
Full   : full


Permissions
We require that API participants link back to the original image when using thumbnails or block/avatar images provided. Additionally if you are an API participant and would likeuploaded hotlinked images to be relieved of our "marking" then feel free to contact us and we will promptly handle this for you if we believe your application is deeming. Also, if you would like to be recognized for uploads (i.e. "Uploaded from MyAPP") then feel free to contact us as above as well. Lastly, if you have any issues, report them to report@imj.tw or use the contact form on the contact us page.