BRAX Developer Info

Below are a few examples of developing with the BRAX API.

Retrieving a Single Item

brax.items.getItem( int item_id )

Retrieving a set of Items

brax.items.getItems( struct params )

The following params are supported:

queryIf query param is specified, it limits the returned results to those items that match the given query phrase. This is most often used in searches.
nickThe nick param limits the returned results to those items matching the given nick. This is used when you want to search by author.
tagOnly return results that have the specified tag word.
per_pageHow many items to return.
pagePage number to return. By default, page 1 is returned.
channelLimit results to a those originating from a particular channel. (such as channel #bor only)
domainLimit results to a those originating from a particular domain name. (such as
typeType of items to return (Eg: url, video, embed_video, image, photoset)
sinceReturn only items submitted since a specific date
untilReturn only items submitted up until a specific date
publicWhether or not to return items that are not public (Ie: on the front page)

Adding a New Item

brax.items.addItem( string user_token, string url, string title )

Below is an example of authenticating with BRAX (using the API username test and password testrpc, and submitting a new item.

require 'xmlrpc/client'

server = XMLRPC::Client.new2("")"brax.items.addUrlItem",
        "asx8u0JEduohwe9d8yweihudIUH", # user's token (see Auth section for info)
        "", # submitted url
        "Fancy new irc bot" # title (optional)

Updating an Existing Item

brax.items.updateItem( int item_id, struct params )


brax.items.addTag( int item_id, string tag )
brax.items.deleteTag( int item_id, string tag )

Tag words may only contain certain characters. Namely, no punctuation or extended (unsafe) characters are accepted in a tag word. Tag words are stripped of all non-alphanumeric characters - however spaces ARE allowed.


brax.items.addComment( int item_id, string user_token, string comment )
brax.comments.deleteComment( int comment_id )
brax.comments.getComment( int comment_id )

For a full list of method calls (uses real-time API reflection), see API Methods.

© 2003-2014
Subscribe via Feed or Email