API version 1.1

Twishort API

Twishort API Key
Posting via Twishort API is limited to authorised applications.
To get your Twishort API Key Send us an Email »
If your application is a Twitter client with Twishort support, please contact us so that we can add you to our official Apps Page.

API Documentation


1. Get Long Tweet

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

Note! To get a Long Tweet (full Post text), 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 this endpoint.


2. Post Long Tweet

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 Twitter's OAuth Echo authorization to ensure valid requests. Read more about Twitter OAuth Echo »

HTTP Method
POST
Available Format
JSON
Resource URL
https://api.twishort.com/1.1/post.json

Headers

X-Auth-Service-Provider (required)

It should always equal: https://api.twitter.com/1.1/account/verify_credentials.json

X-Verify-Credentials-Authorization (required)

OAuth parameters requred to call Twitter's verify_credentials endpoint using OAuth in the HTTP header.

It should look like: OAuth oauth_consumer_key=”...”, oauth_token=”...”, oauth_signature_method=”...”, oauth_signature=”...”, oauth_timestamp=”...”, oauth_nonce=”...”, oauth_version=”...”

Note! These headers will be auto generated for you if you use OAuth library like in this Twishort API Example »

Parameters

api_key (required)

Your Twishort API Key.

text (required)

Post text.

title (optional)

Post title.

media (optional)

If you add media=1 to the request, then text_to_tweet will be cut to a smaller number of characters, so you can add media link to your tweet.

Response

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

Errors

In case of error you may 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
	}
	]
}

3. 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

https://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.


Additional information

Examples

Twishort API Example on PHP »

Twishort Apps page

If your application is a Twitter client with Twishort support, please contact us so that we can add you to our official Apps page.

Need help?

Feel free to contact us if you have any questions.