0

When you add this scope inside oauthScopes section in your appscript.json file:

  "oauthScopes": [
    "https://www.googleapis.com/auth/script.webapp.deploy",
  ]

you will see something like this when you attempt to use the addon:

enter image description here

As I understand, this scope will allow the developer to deploy the addon as a web app (a separated web app for each addon user, not the only web app when we Deploy as web app manually in the script editor)


My question is how to actually use this scope to "Publish this application as a web app" ?

I mean in code it must be ScriptApp.deployWebApp(...) or something like that, right?

But I can't find anything here https://developers.google.com/apps-script/reference/script/script-app

6
  • 2
    AFAIK it is possible to programmatically publish a Google Apps Script web app by using Google Apps Script REST API / CLASP but I didn't dig into it yet. Commented Aug 7, 2019 at 3:28
  • Thanks @Rubén, I will try to dig into the path REST API / CLASP Commented Aug 7, 2019 at 3:29
  • The reason I want to do it is that now I do not only need to update spreadsheet (in my previous question) but also need to send email from user account. And manually deploy Web app and Execute the app as: "User accessing the web app" doesn't work because in that case, I need to give access of the script project to the user Commented Aug 7, 2019 at 3:42
  • 2
    To send an email from the user account use MailApp or GmailApp. There is no need to give access them to the script project for that, just set the permissions to execute as the user that is running the web app. Another alternative is to use the Gmail API and OAuth. Commented Aug 7, 2019 at 4:59
  • 1
    AFAICS, Add-on is a single project used by multiple users. So, even if you deploy as a web-app(using google-apps-script-api), you'll only get a single url for all users. But I haven't tested it either. Commented Aug 7, 2019 at 5:16

1 Answer 1

2

I am afraid it currenty is not possible. Ass see in ScriptApp.Service class, you can only disable Web app for script, read their URL, but create new one.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.