I'm using a google script to connect to an external API with the code:
var url='https://app.ecwid.com/api/v1/XXX/orders'
var parameters = { method : 'get',
headers : {'Authorization': 'Bearer '+'yyy'},
contentType:'application/json',
muteHttpExceptions:true};
var response = UrlFetchApp.fetch(url,parameters).getContentText();
Logger.log(response);
But why is this returning the following error?
HTTP ERROR 401
Problem accessing /api/v1/XXX/orders. Reason:
Unauthorized