TweetLater makes certain functions available via an Application Programming Interface (API) so that application developers can integrate their applications with TweetLater.
The API is HTTP-based and is a RESTful resource. It is able to produce results in both XML and JSON formats.
Follow @tweetlaterapi for the latest API news and announcements.
To obtain API support, please submit a support ticket in the TweetLater Support system. Select "Twitter API" on the department selection page.
All API calls must be authenticated POST calls. GET calls are not supported.
Calls are authenticated using either the user's API Key, which is a 32-character alphanumeric string, or using the user's TweetLater username and password. The user obtains her API Key by logging in to TweetLater, and clicking the "API Key" button in the sidebar. The API Key is displayed on that page.
For authentication using the user's API Key, you must add the apikey parameter to the POST call.
For authentication using the user's TweetLater login credentials, you must add both the username and password parameters to the POST call. Note, this is not the Basic authentication method. The credentials must be POST parameters. In other words, it is not "curl username:password http://tweetlaterapi.com/object/method/format/". It is "curl http://tweetlaterapi.com/object/method/format/?username=usernamevalue&password=passwordvalue".
API calls are rate limited, and are tracked by authenticating user. An authenticating user can make a maximum of 100 calls per rolling 60-minute period.
As a general rule of thumb, when you encounter a rate limit exceeded error, back off for at least 30 seconds before attempting the next call.
Calls that run into the rate limit exceeded error are also counted against the rate limit. In other words, if you keeping hitting the API even though you get rate limit exceeded, you will never get anything done because you will always be in rate limit exceeded status.
All calls that are understood by the API return an HTTP response code of 200 OK. However, this does not mean that the API call was valid or successful. You must check the response body to know if an error was returned, or if the requested data was returned.
On calls that the API did not understand, such as an invalid URI, it returns 404 Not Found. It could also return 500 Internal Server Error if something seriously went wrong with the web server.
On calls that are understood by the API and where the request was not successful, the API returns 200 OK and a well-formatted XML or JSON error response in the following construct.
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<error>
<code>400</code>
<message>No POST parameters supplied.</message>
</error>
</resultset>
Errors that result from failure of field validation have the following construct.
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<error>
<code>400</code>
<message>Field validation failed.</message>
<fields>
<field>
<name>account</name>
<emsg>Account is a required field.</emsg>
</field>
<field>
<name>text</name>
<emsg>Tweet text is a required field.</emsg>
</field>
</fields>
</error>
</resultset>
The name element corresponds with the name of the POST parameter.
The code in the code element mimics HTTP response codes, but remember, the actual HTTP response code on the call is 200 OK. The message element contains the reason for the error. The codes, and their broad meaning are:
You specify the desired return format as follows:
For XML: http://tweetlaterapi.com/<object>/<method>/xml/
For JSON: http://tweetlaterapi.com/<object>/<method>/json/
URL: http://tweetlaterapi.com/users/validatekey/<format>/
POST Parameters:
The validatekey method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<response></response>
</resultset>
The response element will contain either valid or invalid.
URL: http://tweetlaterapi.com/users/fetch/<format>/
POST Parameters:
The fetch method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<user>
<first_name></first_name>
<last_name></last_name>
<level></level>
</user>
</resultset>
The level element will contain Professional, Trial, or Free. If it contains Trial, an additional element trial_expire is added, which contains the time at which the trial period expires. The time is in ISO 8601 format 2009-05-29T16:02:00+00:00.
URL: http://tweetlaterapi.com/accounts/fetch/<format>/
POST Parameters:
The fetch method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<accounts>
<account>
<id></id>
<name></name>
<type></type>
<automation>
<autofollow></autofollow>
<autounfollow></autounfollow>
<sendwelcome></sendwelcome>
<vetfollowers></vetfollowers>
</automation>
</account>
</accounts>
</resultset>
The type element contains the account type code, which can be translated to a full description with the accounttypes object. The automation element is present only for Twitter accounts. The values of the automation elements are either TRUE or FALSE.
URL: http://tweetlaterapi.com/accounttypes/fetch/<format>/
POST Parameters:
The fetch method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<accounttypes>
<accounttype>
<code></code>
<description></description>
</accounttype>
</accounttypes>
</resultset>
It is strongly recommended that you retrieve and cache the account types locally. The types will not change. Once in a while an additional type may be added. You only need to refresh the cache when you encounter an unknown account type in the accounts object.
URL: http://tweetlaterapi.com/tweets/fetch/<format>/
POST Parameters:
The fetch method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<tweets>
<tweet>
<id></id> (unique numerical id of the tweet)
<account></account> (numerical id of the account)
<time></time> (ISO 8601 format 2009-05-29T16:02:00+00:00)
<text></text>
<status></status> (Scheduled, Published, or Error)
</tweet>
</tweets>
</resultset>
If the status element contains Error then an additional element error_text is returned, which contains the reason for the error. The error indicates why the publishing of the tweet failed.
URL: http://tweetlaterapi.com/tweets/add/<format>/
POST Parameters:
The add method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<response></reponse> (contains the unique tweet id)
</resultset>
Note that Trial and Professional users can enter spinnable tweet text in their recurring tweets. The format of a spinnable tweet (in the text POST parameter) is {option1|option2|option3|etc}. A spinnable tweet has { (open curly brace) in character position #1, } (close curly brace) in the very last character position, and the different tweet text options are separated with | (the pipe character).
URL: http://tweetlaterapi.com/tweets/update/<format>/
POST Parameters:
The update method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<response></reponse> (contains the unique tweet id)
</resultset>
URL: http://tweetlaterapi.com/tweets/delete/<format>/
POST Parameters:
The delete method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<response></reponse> (contains the unique tweet id)
</resultset>
URL: http://tweetlaterapi.com/recurfrequencies/fetch/<format>/
POST Parameters:
The fetch method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<recurfrequencies>
<recurfrequency>
<code></code>
<description></description>
</recurfrequency>
</recurfrequencies>
</resultset>
It is strongly recommended that you retrieve and cache the recur frequencies locally. The frequencies will not change often. You can safely cache these for seven days before grabbing a new copy.
URL: http://tweetlaterapi.com/dms/fetch/<format>/
POST Parameters:
The fetch method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<dms>
<dm>
<id></id> (unique numerical id of the DM)
<account></account> (numerical id of the account)
<time></time> (ISO 8601 format 2009-05-29T16:02:00+00:00)
<text></text>
<follower></follower>
<status></status> (Scheduled, Published, or Error)
</dm>
</dms>
</resultset>
If the status element contains Error then an additional element error_text is returned, which contains the reason for the error. The error indicates why the publishing of the DM failed.
URL: http://tweetlaterapi.com/dms/add/<format>/
POST Parameters:
The add method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<response></reponse> (contains the unique DM id)
</resultset>
URL: http://tweetlaterapi.com/dms/update/<format>/
POST Parameters:
The update method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<response></reponse> (contains the unique DM id)
</resultset>
URL: http://tweetlaterapi.com/dms/delete/<format>/
POST Parameters:
The delete method returns the following:
<resultset xmlns="http://www.w3.org/TR/xptr-xmlns/">
<response></reponse> (contains the unique DM id)
</resultset>