baramofme / notion-gcal-sync-appsscript

0 stars 0 forks source link

Request had insufficient authentication scopes when run locally using clasp with gcp #2

Closed baramofme closed 1 month ago

baramofme commented 1 month ago
Exception: GoogleJsonResponseException: API call to calendar.calendarList.list failed with error: Request had insufficient authentication scopes. [
  { function: 'getAllCalendar', lineNumber: 162 },
  { lineNumber: 15 },
  { lineNumber: 17 }
]
ScriptError

add below code in appsscript.json

  "oauthScopes": [
    "https://www.googleapis.com/auth/calendar"
  ]

https://developers.google.com/identity/protocols/oauth2/scopes?hl=ko

push code to gcp and run main code

clasp push && clasp login --creds [your cred file].json

accept authorization request on new popup.

baramofme commented 1 month ago
Exception: Exception: You do not have permission to call UrlFetchApp.fetch. Required permissions: https://www.googleapis.com/auth/script.external_request [        
  { function: 'notionFetch', lineNumber: 474 },
  { function: 'getOnlyCancelledTagedPagesNotion', lineNumber: 17 },
  { function: 'processCancelledEvents', lineNumber: 8 },
  { function: 'main', lineNumber: 3 }
]
ScriptError

do it again!