NodeRed and Baserow API

Hey Guys,

sorry this is the 100. Question in the Shape of “Connecting Baserow to X”

I have issues trying to connect my Nodered Instance to Baserow.
Now I have generated my Bearer Token but for whatever reason I never get past the Authorization.
I tried the following Configurations:

I always get “{“detail”:“Authentication credentials were not provided.”}”

Im pretty sure my token and URL is correct.
URL is http://10.1.1.200:8124/api/database/rows/table/779/1/

Hi,

The issue with the http-request node in Node-Red is that you cannot send the required header data to authenticate with the Baserow API. Therefore, you need to add an additional function node that provides the header information.

The function node contains the following code

msg.headers = {};
msg.headers['Authorization'] = 'Token xxx';
return msg;

You connect this function node with the http request node

But since you already set the header information in the function node, you do not need to set any authentication here.

Regards
Frederik

1 Like

image


hi i think my problem is related here. im trying to make a new table via api and im getting invaild in return. i use “token abc123” for my auth in updating rows but im having trouble making new table as it wont accept that same auth. i think that JWT thing is what i need? is it just the same as the api code or do i have to get that elsewhere or i need more things for it? thanks

id like to add this is selfhost if that matters

Hi,

Data operations such as creating, reading, updating and deleting records can be done with a database token.

Operations that change something to the database structure, such a creating a new table, require a JWT token. This kind of token is only valid for a very limited period of time (about 7 minutes).

So, you probably copy/pasted the token in the screenshot from your browser inspector? The error message indicates that it is no longer valid.

The solution is to do an additional API request to get such a token. This can be done through the endpoint: http://localhost/api/user/token-auth with the email and password in the body of the request: Baserow API spec

You can pass the access_token from the response to the Authorization header of you request to create a new table. NOTE: don’t forget to put JWT in front of it.