ScriptApp Error OAuth2

113 views
Skip to first unread message

Shubham Verma

unread,
Apr 10, 2024, 7:17:07 AM4/10/24
to Google Ads API and AdWords API Forum
Hello,

I'm encountering an issue with accessing ScriptApp.getProjectTriggers() in my script. When I try to call this function, it fails with the following error message:

Exception: You do not have permission to call ScriptApp.getProjectTriggers. Required permissions: https://www.googleapis.com/auth/script.scriptapp

Here's the relevant code snippet:
```
function existingTriggers() {
  return ScriptApp.getProjectTriggers();
}

```
I've already added the necessary OAuth scopes in my appsscript.json file:

```
{
  "oauthScopes": [
    "https://www.googleapis.com/auth/spreadsheets",
    "https://www.googleapis.com/auth/script.scriptapp"
  ],
  "timeZone": "Asia/Kolkata",
  "dependencies": {},
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
  "webapp": {
    "executeAs": "USER_DEPLOYING",
    "access": "MYSELF"
  }
}

```
Interestingly, when I manually run the onOpen function by clicking "Run" in the Apps Script editor, it executes without any issues.

Could you please advise on how to resolve this permission error? Thank you.

Google Ads API Forum Advisor

unread,
Apr 10, 2024, 7:20:35 AM4/10/24
to smartsh...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Please note that our team can only assist with the technical queries or concerns related to the Google Ads API. As this issue is related to the Google Ads Scripts, I am routing this request to the Google Ads Scripts team as they are well equipped to assist you with this.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tOzhu:ref" (ADR-00230650)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages