TMBO API Specification

This document describes functions, their arguments, return values, error codes, and other information used to interact with the TMBO server at thismight.be.


Authentication

There are three methods of authentication:


Parameter Types

The API supports 5 distinct data types for parameters, as described below.


Return Types

The API supports 4 formats, which are determined by the server by the filetype extension of the request.


Status Codes

The following error codes are used by the site as return values:


Don't be Retarded

Like the RSS feeds, requests are limited to a maximum of 200 returned elements. If you want to download the entire history of the world since the dawn of time for your research project, that's fine but please sleep between requests.

This API does not support the load of TMBO on its own, so you may find some queries are inefficient and take a while to complete. If you notice calls taking more than two seconds, please send an email or open a ticket with the method/arguments you're requesting, and try to reduce your usage until the problem is addressed.


More

The user-agent of the client is used to identify the client.
If you are developing an application, please send an email or open a ticket with your application name and a sample user agent.


Examples

Here are some useful examples:

More examples for each method can be found with its documentation.


Function Definitions

To jump to a function, click its link below:


getuploads

Get one or more uploads' metadata, including (if possible) links to the uploaded files themselves, and their thumbnails.

Arguments:

Returns:

Array of Upload objects.

Examples:

getuploads.xxx?type=image&nsfw=0&sort=date_asc&limit=3,10: json plist php xml

See Also:

getupload - Get an upload's metadata, including (if possible) links to the uploaded files themselves, and their thumbnails. Calling this function updates your pickuplink.


getupload

Get an upload's metadata, including (if possible) links to the uploaded files themselves, and their thumbnails.

Calling this function updates your pickuplink.

Arguments:

Returns:

A singleton Upload object or an Error object if upload does not exist.

Examples:

getupload.xxx?fileid=2: json plist php xml

getupload.xxx?fileid=112: json plist php xml

See Also:

getuploads - Get one or more uploads' metadata, including (if possible) links to the uploaded files themselves, and their thumbnails.


getyearbook

Get upload metadata for one or more users' current avatars.

To access non-current avatars, use getuploads(type=avatar).

Arguments:

Returns:

A singleton Upload object if userid is specified, an array of Upload objects otherwise. Returns false if the userid does not exist.

Examples:

getyearbook.xxx?userid=2054: json plist php xml

getyearbook.xxx?limit=2&sort=date_asc: json plist php xml

See Also:

getuploads - Get one or more uploads' metadata, including (if possible) links to the uploaded files themselves, and their thumbnails.


getuser

Get a user's metadata.

Arguments:

Returns:

If the userid exists, returns a user metadata object. Returns false if the userid does not exist.

Examples:

getuser.xxx?userid=151: json plist php xml


getposse

Get a user's posse.

Arguments:

Returns:

If the userid exists, returns a possibly-empty array of user metadata objects. Returns false if userid does not exist.

Examples:

getposse.xxx?userid=2054: json plist php xml

getposse.xxx?userid=22: json plist php xml

See Also:

getuser - Get a user's metadata.


login

Establish a session for future requests and/or generate a token.

The token is named after the user-agent of the requesting application and can be revoked by the user at any time in /offensive/?c=settings.

Arguments:

Returns:

a token object or the metadata for the current user.

Examples:

login.xxx?username=jonxp&password=tester: json plist php xml

login.xxx?username=ray&password=tester&gettoken=1: json plist php xml

See Also:

getuser - Get a user's metadata.

logout - Destroys the current session and invalidates the rememberme cookie. Unnecessary if you are only using a token to authenticate, which doesn't create a login session.


logout

Destroys the current session and invalidates the rememberme cookie.

Unnecessary if you are only using a token to authenticate, which doesn't create a login session.

This method takes no arguments.

Returns:

true

Examples:

logout.xxx?: json plist php xml

See Also:

login - Establish a session for future requests and/or generate a token. The token is named after the user-agent of the requesting application and can be revoked by the user at any time in /offensive/?c=settings.


getcomments

Arguments:

Returns:

An array of comment objects.

Examples:

getcomments.xxx?thread=112: json plist php xml


postcomment

Post a comment to a thread.

All parameters to this function are processed via the POST method, to prevent malicious votes via link shorteners.

No examples yet pending doc system support for POST in examples. Sorry.

Arguments:

Returns:

Comment object or false if nothing was added to the database.


searchuser

Find a user by username.

Arguments:

Returns:

Array of User objects matching query string.

Examples:

searchuser.xxx?q=max&limit=3: json plist php xml

See Also:

getuser - Get a user's metadata.


searchuploads

Find an upload by filename.

Arguments:

Returns:

Array of Upload objects matching query string.

Examples:

searchuploads.xxx?q=weekend&limit=5: json plist php xml

See Also:

login - Establish a session for future requests and/or generate a token. The token is named after the user-agent of the requesting application and can be revoked by the user at any time in /offensive/?c=settings.


getlocation

Get the reported location of one or more maxxers.

This data is user-reported, so it's likely that everyone is lying.

The format of the data returned from this call is unstable and subject to change. Do not use this in a shipping application.

Arguments:

Returns:

An array of location data from the database matching the parameters.

Examples:

getlocation.xxx?limit=5: json plist php xml

getlocation.xxx?userid=2054: json plist php xml

See Also:

setlocation - Set a user's location


setlocation

Set a user's location

Arguments:

Returns:

true

Examples:

setlocation.xxx?lat=50&long=50: json plist php xml

See Also:

getlocation - Get the reported location of one or more maxxers. This data is user-reported, so it's likely that everyone is lying. The format of the data returned from this call is unstable and subject to change. Do not use this in a shipping application.


get_preference

Retrieves the given user preference

Arguments:

Returns:

The value of the preference (may be null)

Examples:

get_preference.xxx?key=ipickup: json plist php xml

See Also:

set_preference - Set the given user preference


set_preference

Set the given user preference

Arguments:

Returns:

true

Examples:

set_preference.xxx?key=ipickup&value=12345: json plist php xml

See Also:

get_preference - Retrieves the given user preference


unreadcomments

Get a list of unchecked activity on subscribed threads.

Arguments:

Returns:

Array of Comment objects containing the oldest unread comment for each thread with unread comments.

Examples:

unreadcomments.xxx?limit=3&sort=file_asc: json plist php xml

See Also:

getcomments -

subscribe - (Un)Subscribe to new posts in a thread.

resetsubscription - Reset your subscription to a thread. New posts made to the thread after this call will cause the subscription to become active again.


subscribe

(Un)Subscribe to new posts in a thread.

Arguments:

Returns:

unsubscribe always returns true. subscribing returns false if thread does not exist.

Examples:

subscribe.xxx?threadid=211604&subscribe=1: json plist php xml

See Also:

resetsubscription - Reset your subscription to a thread. New posts made to the thread after this call will cause the subscription to become active again.

unreadcomments - Get a list of unchecked activity on subscribed threads.


resetsubscription

Reset your subscription to a thread. New posts made to the thread after this call will cause the subscription to become active again.

Arguments:

Returns:

true if reset, false if no subscription or upload does not exist.

Examples:

resetsubscription.xxx?threadid=309779: json plist php xml

See Also:

subscribe - (Un)Subscribe to new posts in a thread.

unreadcomments - Get a list of unchecked activity on subscribed threads.


Errata

If the API lacks notable functionality, or operates in an unexpected manner, please report this behaviour (expected and actual, if applicable) to the tmbotech mailing list, open a new issue, or send numist an email.


Changelog