Below is the Powewrshell that I use to get JSON back from my API call to a 3rd party app. I tried everything to configure it using n8n HTTP Request using Headers and setting up a Key Credential, it gives me URL invalid. Can not figure it out, in powershell works fine. What goes where in the HTTP Request from the powershell API call?
Powershell (masked values for security reasons):
$cloudUrl = “test.fake.com”
$rackAPIKey = “oooooooo8888p/wMAAA===”
$apiEndpoint = “api/123/Desktop/SV_test?groupId=All%20Systems” #The endpoint to call.
Set up the request headers to use the API key.
$requestHeaders = @{
Host=$cloudUrl
‘rack-api-key’=$rackAPIKey
}
Call a rack API Endpoint
$apiResponse = Invoke-WebRequest -Method Get -Uri “https://$cloudUrl/$apiEndpoint” -Headers $requestHeaders -UseBasicParsing