# HTTP request using BasicOAuth2 with ''grant\_type'' = ''api\_key''

**URL:** <https://discourse.nodered.org/t/http-request-using-basicoauth2-with-grant-type-api-key/68788>\
**Category:** General\
**Tags:** http-request\
**Created:** [10 October 2022 08:02 UTC](https://discourse.nodered.org/t/http-request-using-basicoauth2-with-grant-type-api-key/68788 "2022-10-10T08:02:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zouhir](https://avatars.discourse-cdn.com/v4/letter/z/4af34b/32.png) [@zouhir](https://discourse.nodered.org/u/zouhir)\
**Post date:** [10 October 2022 08:02 UTC](https://discourse.nodered.org/t/http-request-using-basicoauth2-with-grant-type-api-key/68788/1 "2022-10-10T08:02:22Z")

</div>

Hi, I'm basically using a basic authentication with my username & password to retrieve an access token which is for some reasons not working anymore.  
Can you please help me do the same using a BasicOAuth2 with ''grant\_type'' = ''api\_key''. I have the corresponded API key, I just don't know how to write it, should I do it via the same HTTP block or use a function ?  
With thanks.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6d30c68442ebdbf40eff6f7e33bb676ad11b7998.png)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [10 October 2022 14:57 UTC](https://discourse.nodered.org/t/http-request-using-basicoauth2-with-grant-type-api-key/68788/2 "2022-10-10T14:57:37Z")

</div>

There is no such thing as 'BasicOAuth2' - it is either Basic or OAuth2. If it is OAuth2, it is not very simple unfortunately.

---

<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:** [9 December 2022 14:57 UTC](https://discourse.nodered.org/t/http-request-using-basicoauth2-with-grant-type-api-key/68788/3 "2022-12-09T14:57:43Z")

</div>

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