API version 1.1

Twishort API


Twishort API Key
Posting via the Twishort API is limited to authorised applications.
Send us an email to obtain your Twishort API Key.

API Documentation


Get Long Tweet

http://api.twishort.com/1.1/get.json?uri=cbbbc&api_key=xxxxx where cbbbc is uri of the post twishort.com/cbbbc and xxxxx is your API Key.

Note! If you want to get long tweet, your API Key must have read permissions. To obtain permissions please contact us. We only ask that you include a link back to Twishort when using get method.


Post Long Tweet

Description

Twishort API allows you to post to Twishort before posting to Twitter and receive a tweet-sized message with a link to the complete post.

Twishort API requires OAuth Echo authorization to ensure valid requests. More about OAuth Echo at dev.twitter.com/oauth/echo.

HTTP Method
POST
Available Formats
JSON
Resource URL
http://api.twishort.com/1.1/post.json
Headers

Note! These headers will be auto generated if you use OAuth library like this Twishort API example with tmhOAuth library.

X-Auth-Service-Provider (required)

https://api.twitter.com/1.1/account/verify_credentials.json

X-Verify-Credentials-Authorization (required)

All the OAuth parameters necessary so it could call dev.twitter.com/rest/reference/get/account/verify_credentials using OAuth in the HTTP header (e.g. it should look like OAuth oauth_consumer_key="...", oauth_token="...", oauth_signature_method="...", oauth_signature="...", oauth_timestamp="...", oauth_nonce="...", oauth_version="..." ).
Example
OAuth realm="http://api.twitter.com/",
oauth_consumer_key="GDdmIQH6jhtmLUypg82g",
oauth_signature_method="HMAC-SHA1",
oauth_token="819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw",
oauth_timestamp="1272325550",
oauth_nonce="oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y",
oauth_version="1.0",
oauth_signature="yOahq5m0YjDDjfjxHaXEsW9D%2BX0%3D"
Parameters

api_key (required)

Your Twishort API Key.

text (required)

Post text.

title (optional)

Post title.

Response

If you receive a 200 OK header, the text was posted successfully.
Example
200 OK
{
  "id":"cbbbc",
  "url":"http://twishort.com/cbbbc",
  "created_at":"Mon, 10 Dec 2012 12:07:28 +0000",
  "text_to_tweet":"text for the tweet… http://twishort.com/cbbbc",
  "user":
  {
    "id":835657794,
    "id_str":"835657794",
    "screen_name":"testuser"
  }
}
Error Response

In case of error you can recieve 400 Bad Request, 403 Forbidden, 404 Not Found, etc.
See the error description in the JSON body for more info.
Examples
403 Forbidden
{
  "errors":[
    {
      "message":"Invalid API Key",
      "code":131
    }
  ]
}
400 Bad Request
{
  "errors":[
    {
      "message":"Missing headers: No 'X-Verify-Credentials-Authorization' provided",
      "code":102
    },
    {
      "message":"Missing parameters: No 'api_key' provided",
      "code":111
    }
  ]
}

Update IDs

Once a message has been successfully posted to Twishort and Twitter, it would be really useful to send back the Twitter ID and some other values from the Twitter response. It makes replies much more effective and allows to display media inside Twishort post.

URL

http://api.twishort.com/1.1/update_ids.json

Headers

The same as post.

Parameters

api_key (required)

Twishort API Key.

id (required)

id of the Twishort post (e.g. cbbbc).

tweet_id (required)

id_str of the tweet you've just posted to Twitter (e.g. 114749583439036416).

reply_to_tweet_id (optional)

in_reply_to_status_id_str of the tweet you've just posted to Twitter.

reply_to_user_id (optional)

in_reply_to_user_id_str of the tweet you've just posted to Twitter.

media (optional)

If you attached media to your tweet, place here media entity from the Twitter response as is.

Examples

PHP Example on GitHub »

Feel free to contact us if you have any questions.

Twimap New!
Twitter on the Map.
TwiAge
Find out your Twitter age.
Your Ad Here
Contact us for details.