Why is test deployment not working while normal deployment is OK

71 views Asked by At

I have an GAS API that works fine with normal deployment. (currently it just adds a timestamp to a spreadsheet for testing purpose). But when I use the test deployment URL (incl. the ..../dev) it runs into 401 or 403. The normal deployment is the very latest version, so the test deployment is same as normal live version.

What could be the cause of that?

I'm pretty novice/layman in this API and authorization domain.

appscript.json:

{
  "timeZone": "Europe/Brussels",
  "dependencies": {},
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
  "webapp": {
    "executeAs": "USER_DEPLOYING",
    "access": "ANYONE_ANONYMOUS"
  }
}
1

There are 1 answers

0
Zjost On

I build in a dual solution with both POST and GET. Seems to work fine. So I can easily use a URL with parameters in browser. (Wouldnt know how to do a post with parameters in an easy way other than using an application like in my case MessageBird. But that is probably due to my lack of programming experience).


  const params = e.parameter;
  let resp = apiPostponeOrCancelReOrdering(params);
  Logger.log(resp);
  return ContentService.createTextOutput(resp);
}

function doPost(e){

  var params = JSON.parse(e.postData.contents);
  let resp = apiPostponeOrCancelReOrdering(params);
  Logger.log(resp);
  return ContentService.createTextOutput(resp);
}

function apiPostponeOrCancelReOrdering(params){xxx}```