# Connexion API with credentials / bearer token

**URL:** <https://discourse.nodered.org/t/connexion-api-with-credentials-bearer-token/54827>\
**Category:** General\
**Tags:** http-request\
**Created:** [7 December 2021 15:42 UTC](https://discourse.nodered.org/t/connexion-api-with-credentials-bearer-token/54827 "2021-12-07T15:42:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre1987](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Alexandre1987](https://discourse.nodered.org/u/Alexandre1987)\
**Post date:** [7 December 2021 15:42 UTC](https://discourse.nodered.org/t/connexion-api-with-credentials-bearer-token/54827/1 "2021-12-07T15:42:36Z")

</div>

I'm trying to create a client API connection flow. The information I have to create this feed is:

-the root of the API: http s://mywebsite.com/  
-user: "usertest"  
-password: "mypassword"  
-my endpoint for authentification: http s://mywebsite.com/authentication

And the information that the token returned during authentication is sent in JSON format.

{  
“BearerToken”: “{tokenValue}”  
}

I have tried several setups and will start from scratch. I'm really new in development and trying to make this connection to my client API properly.

My flow is very simple:

-I have one timestamp for start the flow  
-I have a function that sends my credentials in the header  
-A post request to the URL: [https://mywebsite.com/authentication](https://mywebsite.com/authentication)  
-for the moment, one debug for see the status.

I have tried a lot of configuration but with no luck. I would really be grateful if someone would make an example of a connection

I remain really available to follow your directions.

Thanks again in advance

Alexandre

---

<div class="post-metadata">

**Author:** ![vongomben](https://avatars.discourse-cdn.com/v4/letter/v/a4c791/32.png) [@vongomben](https://discourse.nodered.org/u/vongomben)\
**Post date:** [30 December 2021 17:44 UTC](https://discourse.nodered.org/t/connexion-api-with-credentials-bearer-token/54827/2 "2021-12-30T17:44:26Z")

</div>

Hi.  
Thanks for bringing this up.  
Whenever I want to intergrate Node-red in a more complex APIs, I bump into the bearer token problem: very few examples on how to overcome this within node-red.

Since it's on my todo-list to cerate a well documented example for my students, I saved some info that I found online. Didn't have time to dig into it yet though..

[This video](https://youtu.be/sS9bBBb84sY?t=306) (from this time) from Thomas Südbröcker is a good start, he is using [a flow](https://github.com/thomassuedbroecker/absolute-beginner-node-red-flow/blob/master/node-red-flow/httprequest-flow.json) from [his course](https://thomassuedbroecker.github.io/absolute-beginner-node-red-flow/).

I definetly need to give a look at both 🙂

Please update me if you manage to have a working example.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 February 2022 17:44 UTC](https://discourse.nodered.org/t/connexion-api-with-credentials-bearer-token/54827/3 "2022-02-28T17:44:57Z")

</div>

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