Enrich your web app with traffic details

Unlimited possibilities

With our API, you can extend your projects for free (check terms and conditions for more details) by connecting to our servers for traffic details around bus-stops.


Twitter-compatible API

The goal of the Twitter-ish API is to make it extremely easy for developers with tools that already talk to Twitter to communicate with Tsaboin TrafficTalk as well. The most used methods will be implemented first.

The official Twitter API documentation (https://dev.twitter.com/docs) is a good place to start for information about this API. We intend to provide full documentation on this site, but for now will have the exceptions. The following will be mostly useful for devs experienced with the Twitter API and getting ready to build in Tsaboin TrafficTalk compatibility.

API root

The API root for tsaboin.com is at https://www.tsaboin.com/api. However, there is no resource at the API root.

To make API calls you tack on the method name. Examples:

http://www.tsaboin.com/api/statuses/public_timeline.xml

http://www.tsaboin.com/api/statuses/show/123.xml

http://www.tsaboin.com/api/friendships/exists.json?user_a=dele&user_b=kayslay

 

Authentication

OAuth authentication

Tsaboin TrafficTalk supports OAuth 1.0a authentication for API resources. Generally, Tsaboin TrafficTalk’s UI and API are similar to Twitter’s for OAuth applications. To use OAuth with Tsaboin TrafficTalk, you’ll need to register your client application via the web interface and obtain a consumer key and secret. You can find the interface for application registration under settings/oauthapps. E.g.:

https://www.tsaboin.com/settings/oauthapps

SSL

Tsaboin.com supports SSL for all API methods, and it’s especially recommended for use with API methods requiring authentication (e.g.: https://www.tsaboin.com/api/account/verify_credentials.xml).

JSONP callbacks

For API methods that return JSON, an optional JSONP-style callback parameter is supported. If supplied, the response will be in JSONP format with a callback of the given name. To make it easier for clients to handle error conditions, HTTP error codes are suppressed, and the errors will be returned in the response body when using JSONP.

https://www.tsaboin.com/api/statuses/public_timeline.json?callback=foo

Rate limiting

We currently don’t enforce any rate-limiting. Please don’t make us regret it.

NOTE

Some things to remember:

  • The since_id parameter does not work as documented by Twitter. Twitter says of since_id: “There are limits to the number of Tweets which can be accessed through the API. If the limit of Tweets has occured since the since_id, the since_id will be forced to the oldest ID available.” However, Tsaboin TrafficTalk will return the newest notices (or the newest back from max_id, if present)!! Also, a since_id <= 0 will be ignored.

 

Resources

Timeline resources

statuses/public_timeline As documented.
statuses/home_timeline Fully compatible with enhancements.
statuses/friends_timeline Alias of home_timeline.
statuses/mentions Fully compatible with enhancements.
statuses/replies Alias of mentions.
statuses/user_timeline As documented.

 

Status resources

statuses/show As documented.
statuses/update As documented. Additional ‘media’ parameter allows binary multimedia uploads (images, etc.). Format post data as multipart/form-data when using the ‘media’ parameter.
statuses/destroy As documented.
statuses/retweet As documented. Note: we call these broadcasts in the web interface.

 

User resources

statuses/friends As documented, except: does not support ‘lite’ parameter. Also, ordered by subscription and not signup date.
statuses/followers As documented, except: does not support ‘lite’ parameter. Also, ordered by subscription and not signup date.
users/show As documented. Additionally, you can bring up a user by email address alone. A user id is not required if an email address is supplied.

 

Direct message resources

direct_messages As documented.
direct_messages/sent As documented.
direct_messages/new As documented.
direct_messages/destroy Not implemented.

 

Friendships resources

friendships/create As documented.
friendships/destroy As documented.
friendships/exists As documented.
friendships/show As documented.

 

Friends and followers resources

friends/ids As documented.
followers/ids As documented.

 

Account resources

account/verify_credentials As documented.
account/end_session Not implemented.
account/update_location As documented.
account/update_delivery_device Not implemented.
account/rate_limit_status We have no rate limit, so this always returns 150 hits left.
account/update_profile_background_image As documented.
account/update_profile_image As documented.

 

Favorite resources (Called Confirms on the web interface)

favorites As documented.
favorites/create As documented.
favorites/destroy As documented.

 

Block resources

blocks/create As documented.
blocks/destroy As documented.
blocks/exists Not implemented yet.
blocks/blocking Not implemented yet.

 

OAuth resources

oauth/request_token As documented.
oauth/authorize As documented.
oauth/access_token As documented.

 

Search

Tsaboin TrafficTalk has a Twitter-compatible notice search, and search results can be returned in both Atom and JSON formats.

Atom

To request search results in Atom, append your URL-encoded query as a parameter to the search method and specify the Atom format:

https://www.tsaboin.com/api/search.atom?q=<query>

JSON

To request search results in JSON, append your URL-encoded query as a parameter to the search method and specify the JSON format:

https://www.tsaboin.com/api/search.json?q=<query>

The search method also supports the following optional URL parameters:

  • callback: if supplied when using the JSON format, the response will use the JSONP format with a callback of the given name.
  • E.g.:
    • https://www.tsaboin.com/api/search.json?callback=foo&q=ikorodu
  • rpp: the number of notices to return per page, up to a max of 100.
  • E.g.:
    • https://www.tsaboin.com/api/search.atom?q=ikeja&rpp=15
  • page: the page number (starting at 1) to return.
  • since_id: returns notices with ids greater than the given id.

 

Tsaboin TrafficTalk resources

These are extensions to the Twitter API that expose Tsaboin TrafficTalk specific functionality.

Bus Stop resources

Bus stops are treated as groups

traffictalk/busstop/timeline GET Shows a group’s timeline. Similar to other timeline resources. params: page (int), count (int), max_id (int), since_id (int), format (string, ‘xml’, ‘json’, ‘atom’, or ‘rss’), callback (string, JSON-P callback) [format is required]
traffictalk/busstop/show GET Show a group’s profile. params: id (string, group ID or nickname), group_id (int), group_name (string), format (string, ‘xml’ or ‘json’), callback (string, JSON-P callback) [format is required; must also include a param identifying a group]
traffictalk/busstop/create POST Create a new group. params: nickname (string, name of the group), full_name (string), homepage (string), description (string), location (string), aliases (string, comma-separated), format (string, ‘xml’ or ‘json’), callback (string, JSON-P callback function) [format and nickname are required]
traffictalk/busstop/join POST Join a group. params: id (string, group ID or nickname), group_id (int), group_name (string), format (string, ‘xml’ or ‘json’), callback (string, JSON-P callback) [format is required; must also include a param identifying a group]
traffictalk/busstop/leave POST Leave a group. params: id (string, group ID or nickname), group_id (int), group_name (string), format (string, ‘xml’ or ‘json’), callback (string, JSON-P callback) [format is required; must also include a param identifying a group]
traffictalk/busstop/list GET Show the groups a given user is a member of. params: id (string, user ID or nickname), user_id (int), screen_name (string), format (string, ‘xml’ or ‘json’), callback (string, JSON-P callback) [format is required; must also include a param identifying a user]
traffictalk/busstop/list_all GET List all local groups. params: page (int), count (int), format (string, ‘xml’, ‘json’, ‘atom’, or ‘rss’), callback (string, JSON-P callback) [format is required]
traffictalk/busstop/membership GET List the members of a given group. params: id (string, group ID or nickname), group_id (int), group_name (string), format (string, ‘xml’ or ‘json’), callback (string, JSON-P callback) [format is required; must also include a param identifying a group]
traffictalk/busstop/is_member GET Determine whether a given user is a member of a given group. params: id (string, user ID or nickname), user_id (int), group_id (int), screen_name (string), group_name (string), format (string, ‘xml’ or ‘json’), callback (string, JSON-P callback) [format is required; must also include a param identifying a user, and a param identifying a group]