TheBrain now has an API

For Tinderbox users interested in integrations, TheBrain has today introduced an API

This could be useful in Posters, and other cases.

2 Likes

This raises some interesting ideas for inter app workflows. Harlan Hughes has written on TheBrain Forum that this is a “full-featured REST API,” and that makes me wonder if a CURL call from Tinderbox’s Send Command could pull data from TheBrain, a la @webline 's work making calls to ChatGPT.

Absolutely. For bigger stuff, you might instead write the glue in python or node, but curl should certainly be fine. (I’m surprised they don’t have a few curl examples…)

it is a REST interface, so no problem to use cURL - but you could use the great new fetch command in TBX too.

        var string aServerULR = "https://app.thebrain.com";
        var string myBrainID = "123456";
	var string myPayload = "/api/createThought?brainId=" + myBrainID;
	
	fetch(aServerULR + myPayload,{Content-Type: application/json},"aTempVariable","doProcessCallback(aTempVariable);",POST)
	
	function doProcessCallback(returnValue:string) {
   		show(returnValue);
	};

Should do it - this is untested - I don’t use TheBrain. I’m pretty sure you need to set an authorisation token in the header.

2 Likes