BRAX Developer Info





The BRAX API is available for non-commercial use by outside developers. For the time being, you will need to be setup manually by us to access the API. Contact us in channel #bor on efnet to get setup with access to the API.

To authenticate users for your application, you'll be using the brax.auth.identify() method. The identify method requires two arguments, a username and a password.

Identifying a Bordom.net User

brax.auth.identify( string username, string password )

If the username and password matches, this method will return a user token string, which will be used for performing all other subsequent calls to the API that require user authentication.

Example Code

The following is an example of how to identify a user on Bordom.net using the Ruby XML-RPC client.

require 'xmlrpc/client'

# Instantiate client object and connect to BRAX API
# with your API username and password
@rpc_client = XMLRPC::Client.new3({
  :host=>'www.bordom.net',
  :path=>'/rpc/',
  :user=>API_USERNAME,
  :password=>API_PASSWORD
})

# Authenticate a Bordom.net user account by passing a 
# username and password.  A unique identification token is returned.
begin
  user_token = @server.call("brax.auth.identify",BORDOM_NICK,BORDOM_PASS)
rescue XMLRPC::FaultException => e
  # Handle error e.faultString
end

At this point, the user_token string is then used to pass into other API methods that require user authentication.

Performing User-Level Actions

Now that we've successfully authenticated this user, we can permit them to perform user-level actions such as bumping an item to the front page:

brax.items.bumpItem( int item_id, string user_token )

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


ADVERTISEMENT
© 2003-2014 bordom.net
Subscribe via Feed or Email

FeedbackAdvertisingTerms

“lol requires an argument”
—joeyo