Reputation: 41
I am trying to execute a google script via API. I have authorized with all the necessary scopes and included my parameters, function, and dev mode:
POST https://script.googleapis.com/v1/scripts/{scriptId}:run
{
"devMode":true,
"function":"createNewSpreadsheetTrigger",
"parameters":["{fileId}"]
}
But keep getting a 403:
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}
I created this script with the same account that is trying to remotely execute.
Thoughts?
Thanks!
Upvotes: 4
Views: 4839
Reputation: 2331
Per documentation -
The error
403, PERMISSION_DENIED
: The caller does not have permission indicates that the Cloud Platform project used to authorize the request is not the same as the one used by the script.
I'd stumbled upon similar issues and so I'd created this article explaining the best course of action that suited my use-case.
However, here are the recommended steps -
Hope this helps.
Upvotes: 4