Enable Advanced Services for Apps Script projects via CLI
See original GitHub issueExpected Behavior
To use Google APIs (Advanced Services) in Apps Script, you must enable APIs in the online editor at script.google.com > Resources > Advanced Google Services...
You should be able to setup a project without having to go to the editor. I propose a function to enable APIs in clasp
like the UI.
Commands
clasp apis list
clasp apis enable "drive.googleapis.com"
clasp apis disable "drive.googleapis.com"
list
would list all Google APIserviceId
senable
/disable
a API for the Cloud project
Eventually autocomplete:
clasp apis enable # select from list of all Google APIs that aren't enabled
clasp apis disable # select from list of enabled APIs in the manifest
API
These commands would use the serviceuser.projects.services
API. It would require a personal Cloud project.
projects/project-id-0486239153690933627/services/drive.googleapis.com
EDIT: User serviceusage not serviceuser since that’s the newer API.
- List Services API: https://developers.google.com/apis-explorer/#p/discovery/v1/discovery.apis.list
- Enable Service API: https://developers.google.com/apis-explorer/#p/serviceuser/v1/serviceuser.projects.services.enable
- Disable Service API: https://developers.google.com/apis-explorer/#p/serviceuser/v1/serviceuser.projects.services.disable
Result
The result of enabling an advanced service via the UI is:
- Enabling the API for your Cloud Console project
- Adding some data to your
appsscript.json
.
"dependencies": {
"enabledAdvancedServices": [{
"userSymbol": "AdSenseOrWhatever",
"serviceId": "adsense",
"version": "v1.4"
}]
}
Actual Behavior
Users have to go to script.google.com to enable advanced services.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Advanced Google services | Apps Script
Enable advanced services · Open the GCP project associated with your script in the Google API Console. · At the top of the...
Read more >Advanced Development Process with Apps Script
This project, “node-google-apps-script”, is a Node.js based command-line interface (CLI) that uses Google Drive API to update Apps Script ...
Read more >clasp - The Apps Script CLI - Google Codelabs
The Apps Script CLI, or clasp , is a tool that lets you to create, edit, and deploy Apps Script projects locally. It...
Read more >Enabling Advanced Google Service in Apps Script for Google ...
1. There is no cost to enabling the Google Drive API. – Alan Wells. Oct 5, 2019 at 19:49 · @AlanWells - I'd...
Read more >How To Script Google Advanced Services - ADocLib
The Apps Script CLI or clasp is a tool that lets you to create edit and deploy Apps for products like Sheets Docs...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rdoursenaud Advanced service aren’t disabled on
push
. You need topull
after you enable an advanced service, because it changes theappsscript.json
file. LMK if you’re still seeing an error.I should document this more.
This feature has been added into
master
. It’ll appear inclasp@2
in December. Marking as fixed.