-1

I have Tried from google script but getting error:

'USER_ERROR error message:No Authorization header'

var url = 'https://debugger.na1.netsuite.com/app/site/hosting/restlet.nl?script=107&deploy=1';

var header = {
    contentType: 'application/json',
    Authorization: 'NLAuth nlauth_account=TSTDRVXXXXX,    nlauth_email=xxx@xxx.com, nlauth_signature=XXXXXXX, nlauth_role=3',
    method: 'GET',
    muteHttpExceptions: true
  };

  var response = UrlFetchApp.fetch(url, header);
quarks
  • 33,478
  • 73
  • 290
  • 513
YNK
  • 129
  • 2
  • 15

1 Answers1

2

You should review the docs for UrlFetchApp. You've collapsed headers and optional params. The setup should be more like:

var params = {
    contentType: 'application/json',
    headers:{Authorization: 'NLAuth nlauth_account=TSTDRVXXXXX, nlauth_email=xxx@xxx.com, nlauth_signature=XXXXXXX,     nlauth_role=3'},
    method: 'GET',
    muteHttpExceptions: true
};
var response = UrlFetchApp.fetch(url, params);
bknights
  • 14,408
  • 2
  • 18
  • 31