Is it possible to call the Apps Script Execution API via a jQuery ajax
method?
I am getting request failures using:
$.ajax({
type: "POST",
url : "https://script.googleapis.com/v1/scripts/{script_id}:run",
data : {
'function' : 'getProjects',
'parameters : [token]'}
},
success : function(msg){
alert('ajax success');
},
error : function(xhr, textStatus, errorThrown){
alert('ajax fail');
}
});
I am not sure that I am submitting the oauth2 token currently as part of the request body.