I'm trying to send HTTP request with Zapier Code to hit my API to do some GET and POST requests.
API requires API_KEY in form of authorization header to understand my requests. Here is code I'm running
var settings = {
"url": "https://<HOST>/api/v1/siteinfo",
"method": "GET",
"headers": {
"authorization": "Basic <TOKEN>",
"cache-control": "no-cache"
}
}
fetch(settings.url, settings)
.then(function (r) {
callback({data: r});
}).catch(callback);
But get this error:
What is wrong with my code?