Patrick Mast
Patrick Mast12mo ago

Need help with Authorization in API Call

Hello, I'm currently working on a test REST API call using the "API Call" node. The challenge I'm facing is that my external API requires an Authorization header, specifically in the format 'apiKey: eaVCRghw0'. I've attempted various approaches to set this up in the "API Call" node, but none have been successful. Here's the cURL command I'm trying to replicate: curl --location 'https://mytest.app/api' --header 'apiKey: eaVCRghw0' Could someone please provide guidance on how to correctly configure the Authorization header in the "API Call" node? Thanks!
3 Replies
Gaurav Chadha
Gaurav Chadha12mo ago
You can modify the authorization to include apiKey in the code: if (authorization) headers["Authorization"] = apiKey ${authorization};
No description
Gaurav Chadha
Gaurav Chadha12mo ago
Also, please don't share your apiKeys publicly, as it can be access by anyone.
Patrick Mast
Patrick MastOP12mo ago
Hey @Gaurav Chadha, thanks a lot for your prompt response. Firstly, I appreciate the heads-up on API key security, but rest assured, the one I shared was just a random placeholder. Regarding the suggestion to modify the code for the "API Call" node, I understand that's a potential solution. However, I was hoping for a more straightforward approach within the standard node's configuration itself. Thanks again!