GAS Execution API Error ScScript function not found: test 」

Asked 2 years ago, Updated 2 years ago, 59 views

Google Apps Script Execution API allows JavaScript to call GAS functions.Authentication is complete, but when I try to do it, I get an error message ScScript function not found: test とThere is a function called test(text) in the script, but it cannot be executed.Please tell me what I should do.

Apps Script

function text(text){
  return("RETURN:"+text);
}

JavaScript

function request(){
  varop=gapi.client.request({
    'root': 'https://script.googleapis.com',
    'path': 'v1/scripts/'+<Enter API_ID here>+':run',
    'method': 'POST',
    'body': {'function': 'test'}
  });
  op.execute(function(resp){
    if(resp.error){
      alert(resp.error.details[0].errorMessage);
    }
    else{
      alert("Success");
    }
  });
}

javascript google-apps-script

2022-09-30 21:18

1 Answers

If the Apps Script code you are asking is verbatim from what is actually being used, the text after the function is probably the wrong test.


2022-09-30 21:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.