Brainfuse API offers the ability for our partners to provide a single sign on system using a simple API.
A sequence diagram of the API looks like the picture below:
For all the URLs above there is a common prefix on the Brainfuse side:
For staging please use http://www.dev.brainfuse.com/jsp/api
For production please use https://www.brainfuse.com/jsp/api from this point onwards this prefix will be called server.
Request to get the user information:
Requests can be made using a get request.
To retrieve the user information please make a request to /getUserId/ for example to do a production request that would be https://www.brainfuse.com/jsp/api/getUserId/
t: launch code provided to the partner website in step 5
k: is an api key that is unique for each client. Please contact Brainfuse at [email protected] to retrieve a launch key.
Valid response is a json object of the following:
userid: <brainfuse userid>,
username: <brainfuse username>,
displayName: <brainfuse display name>
When using Jackson library or other json library please be sure to allow for changes in the object returned. New values can be added frequently.
When an error occur an additional HTTP header is added to the response. The HTTP header name is X-Error. The header includes the error message that the system has encountered.
|Status Message from the X-Error HTTP Header
|Request was successful
|don't have launchCode
|Launch code not provided
|don't have key
|Key is not provided
|key is not correct
|Key is not available on the list
|code can not be decrypted
|The code is not encrypted with a valid key
|code is not correct
|The code provided is not correct
|Time limit passed for Token
|The launch code have expired. Launch codes are only valid for 60 seconds.
|user doesn't exist
|The provided user id no longer exists in the system.