Google App Script 401 connection error
I am using google script to connect to external API with 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 does this return the following error?
HTTP ERROR 401
Problem accessing /api/v1/XXX/orders. Reason:
Unauthorized
+3
source to share
1 answer