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");
}
});
}
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
.
© 2024 OneMinuteCode. All rights reserved.