API DOCUMENTATION
- METHOD: uploadAndPost
- METHOD: upload
- Error codes
- Image Thumbnails


METHOD: http://twitpic.com/api/uploadAndPost

Use this method to upload an image to TwitPic and to send it as a status update to Twitter.

Fields to post in
(post data should be formatted as multipart/form-data):
- media (required) - Binary image data
- username (required) - Twitter username
- password (required) - Twitter password
- message (optional) - Message to post to twitter. The URL of the image is automatically added.

Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<rsp status="ok">
 <statusid>1111</statusid>
 <userid>11111</userid>
 <mediaid>abc123</mediaid>
 <mediaurl>http://twitpic.com/abc123</mediaurl>
</rsp>


METHOD: http://twitpic.com/api/upload

Use this method if you only want to upload a photo to TwitPic.

Fields to post in:
(post data should be formatted as multipart/form-data)
- media (required) - Binary image data
- username (required) - Twitter username
- password (required) - Twitter password

Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<rsp stat="ok">
 <mediaid>abc123</mediaid>
 <mediaurl>http://twitpic.com/abc123</mediaurl>
</rsp>


Sample error response:
<?xml version="1.0" encoding="UTF-8"?>
<rsp stat="fail">
    <err code="1001" msg="Invalid twitter username or password" />
</rsp>


Error codes and their descriptions:
1001 - Invalid twitter username or passwor
1002 - Image not found
1003 - Invalid image type
1004 - Image larger than 4MB


Image thumbnails:
Use the following URL structure to add Twitpic thumbnails into your app:

http://twitpic.com/show/<size>/<image-id>

Size: mini or thumb
Image ID: this is the ID of the Twitpic photo

Example: http://twitpic.com/show/thumb/1e10q

*note: Twitpic Community Guidelines specify that if you use a Twitpic thumbnail in your app, the photo must link back to its original photo page or a link to the original photo page must be provided somewhere within context to the thumbnail

**note: this URL may forward to an amazon s3 URL


How do I get "from [my_application]" appended to updates sent from my API application?
Please email support@twitpic.com with the name, URL, and description of your application. Your application must have a web site to which we can link in order to this up. Please allow up to 48 hours for the link to your application to go live, as this is a manual process contingent on TwitPic's deployment schedule.