I have a small Google Apps Script that I have deployed as API executable.
Although I have made the call with a valid token for the scope I'm using (spreadsheets), I can't get past this 403 PERMISSION_DENIED
error.
I'm now testing this on the API's Explorer with the same error.
Does anyone have any ideas of what I might be missing?
My script is simple (still incomplete, but it runs - which should be enough for these initial tests):
OAuth Scope required by script (copied from API's Explorer):
https://www.googleapis.com/auth/spreadsheets
function myFunction(get) {
var ss = SpreadsheetApp.openById("1axDlnPaoEwhlb_Vs5SLBvkGJrR-fSeOLuHEdSBXCTBg"); // I'm not getting anything from the sheet at this point, I included it just to make sure that the script requires the spreadsheets scope
get += " " + "success!";
return ContentService.createTextOutput(get);
}
The request (copied from API's Explorer):
POST https://script.googleapis.com/v1/scripts/1d1EKj7vi-gzC0gB02qjw_qBPE1zSrZtJp-YUWuKm3NL3-3t6Sixpm0TZ:run?key={YOUR_API_KEY}
{
"function": "myFunction",
"parameters": [
"Hello world!"
]
}
The response (copied from API's Explorer):
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}