Using a bearer token with HTTP request API calls

Just starting out with the HTTP node … however the API that I want to connect to (digitalocean) uses a bearer token authentication method …

I don’t see that auth method anywhere in n8n … (i’ve been using it in postman to test) …

How would I authorize through bearer tokens with the http request node?

Hi @lexgabrees, a bearer token is sent in the header of an HTTP Request.

So you probably want to pick the “Header Auth” option and then use Authorization as the name of the header and Bearer $token as the value.

Hi there … Thanks for the info … Tried it but no luck as it’s giving me a 401 unauthorized … which is strange, because I can’t see that I’m doing anything wrong …

Hm, that might be caused by something else, for example a typo (or leading/trailing whitespace) somewhere. Seeing you have it working in Postman perhaps you can simply copy your request as a curl request and then import it on the HTTP Request node using the “Import cURL” button)?

Actually … I got it to work just now … I forgot to include the ‘Bearer’ in the value …

1 Like

Awesome, glad to hear and thanks a lot for confirming :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.