Returns what permissions the script has been granted.
class ScriptApp method .getAuthorizationInfo()
ScriptApp is the Apps Script service.
.getAuthorizationInfo() is the method name you will see after a dot in your code.
What it does
Why it's used
- See which scopes the user still needs to approve.
- Build a setup screen that explains missing permissions.
Common errors
- Forgetting parentheses on getAuthorizationInfo. Write ScriptApp.getAuthorizationInfo(), not ScriptApp.getAuthorizationInfo or getAuthorizationInfo by itself.
- Skipping dots between chained calls. Each step needs a dot, like ScriptApp.getAuthorizationInfo().
- Adding spaces where they do not belong. Write ScriptApp.getAuthorizationInfo(), not ScriptApp .getAuthorizationInfo(), ScriptApp.getAuthorizationInfo (), or ScriptApp . getAuthorizationInfo().
- Wrong capitalization. Use ScriptApp and getAuthorizationInfo, not scriptapp or getauthorizationinfo.
Explore
Related methods
-
.invalidateAuth()
Clears stored authorization so the user must approve access again.
-
.getScriptId()
Returns the unique ID of the current script project.
-
.getOAuthToken()
Returns an OAuth token for calling Google APIs as the user.
-
.getProjectTriggers()
Returns all triggers set up in the script project.
-
.getService()
Returns a connected advanced Google service, like BigQuery or YouTube.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about ScriptApp.getAuthorizationInfo().
How I Send Invoice Emails Straight From a Google Sheet (With a Script You Can Copy)
A copy-ready Apps Script that emails invoices from a Google Sheet, flags bad rows, and nudges overdue clients once a week. A guest post by Tahir Abbas.
Read post →Everything Aggravating about Apps Script
Been coding Apps Script for almost 10 years. Here's what I still find aggravating in Apps Script. The autocomplete is frustrating. Files don't save with errors. I lose my way in files. And the documentation is atrocious.
Read post →