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


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: ttp://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


How do I get "from [my_application]" appended to updates sent from my API application?
Please email noah@nusoni.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.


©2008 Nusoni, All rights reserved. TwitPic is not affiliated with Twitter
About   API   Help   Feedback   Contact