Cannot use UrlFetchApp in Execution API script

342 views
Skip to first unread message

Tom Doan

unread,
Mar 15, 2024, 3:47:34 AM3/15/24
to Google Apps Script Community
I have two scripts:

A. deployed as Web App
B. deployed as Execution API

In script B, I'm trying to use UrlFetchApp.fetch() to request something from script A, but I get this error in the response:

{
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.apps.script.v1.ExecutionResponse",
    "result": {
      "error": "\"You do not have permission to call UrlFetchApp.fetch. Required permissions: https://www.googleapis.com/auth/script.external_request\""
    }
  }
}

Script B appscript.json:

{
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
  "executionApi": {
    "access": "ANYONE"
  },
  "oauthScopes": [
  ],
  "urlFetchWhitelist": [
  ]
}

Are Execution API scripts not allowed to use UrlFetchApp.fetch() or am I doing something wrong?

Andrew Apell

unread,
Apr 22, 2024, 2:10:58 PM4/22/24
to Google Apps Script Community
This looks like an OAuth issue. You might need to have your project verified.
Reply all
Reply to author
Forward
0 new messages