Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

unable to run app script with service accounts

 

I am using service account to access a Google Sheet via the Apps Script Execution API, but it's showing 403 error .

I get the following error message when I try to run the script 

{
  "error": {
    "code": 403,
    "message": "The caller does not have permission",
    "status": "PERMISSION_DENIED"
  }
}

Does this not work because Service Accounts are never able to access the Execution API?

Is there any other way to do Google Oauth  and which will support App script as well ? 

0 2 1,714
2 REPLIES 2

@baishalij with Apps Script you need to run the script with a Google Workspace account that has access to the Sheet. I don't believe this will work from a Google Cloud Console service account (in that's what you mean by service account). If you are using a GCP account have you tried giving access to that account in the Sheet? 

@StephenHind  I was using google workspace account with OOB google Oauth 2.0 process though OOB has been deprecated, so i was trying to replace it with Google Cloud Console service account . But am unable to run AppScript with it. 

Any suggestion to do Google Oauth  and which will support App script as well ?  

Top Labels in this Space