API Documentation

API Upload (POST w/ OAuth Echo)

  1. How to regegister API

    To get your API key click here
  2. Description

    This API is used for upload photos from your application.
  3. URL

    Application should post image and necessary header to following URL.

    XML format

    http://tweetpic.me/photos/upload.xml

    JSON format

    http://tweetpic.me/photos/upload.json

  4. Fields to post in header

    consumer_key (required) - Twitter consumer key

    consumer_secret (required) - Twitter consumer secret

    media (required) - Binary image data

    application key (required) - Your Tweetpic API key

    message (optional) - Message to post to twitter. The URL of the image is automatically added.

  5. Sample header need to add

    OAuth realm="http://api.twitter.com/",
    oauth_consumer_key="Asxdd&HN4OA7A*n1ozfyhA",
    oauth_signature_method="HMAC-SHA1",
    oauth_token="75267827-yqUybzvuABucfY1FD7q3jnBWcS2xImFALidyfD9LB",
    oauth_timestamp="1304518910",
    oauth_nonce="40697631baa4045a47245f947fc21b88",
    oauth_version="1.0",
    oauth_signature="it0TkgZC2fXFRtqtYU73X19weZA%3D"

  6. Response

    XML

    <?xml version="1.0" encoding="UTF-8"?>
    <rsp status="ok">
    <mediaid>f2a</mediaid>
    <mediaurl>http://tweetpic.me/f2a</mediaurl>
    </rsp>
    

    JSON

    {
     "status" : "ok",
     "mediaid" : "f2a",
     "mediaurl" : "http://tweetpic.me/f2a",
    }   
    

  7. Error codes and their descriptions

    1001 - Invalid twitter consumer key or consumer secret

    1002 - Image not found

    1003 - Application key not valid

  8. Resource

    PHP
    To get your sample code click here
  9. Image thumbnails

    Use the following URL structure to add Tweetpic thumbnails into your app

    http://tweetpic.me/ <type><image-id>
    Type:
    e2 or fe2
    Example:
    http://tweetpic.me/e2a
    *Note:
    Tweetpic Community Guidelines specify that if you use a Tweetpic 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
  10. How do I get "from [my_application]" appended to updates sent from my API application?

    You need to fill the API form with the necessary details, after you submitting that form we will send a unique application key to your mail. Using that key you can upload through your applications. To get your API key click here