简体   繁体   English

从 Google 工作表插件将 Appscript 部署为 Webapp

[英]Deploy Appscript as Webapp from Google sheet Add-on

I want to create a Google sheet add-on where the user can create an HTTPS endpoint in his sheet, that can act as a webhook for an external service.我想创建一个谷歌工作表插件,用户可以在他的工作表中创建一个 HTTPS 端点,它可以充当外部服务的 webhook。 I can see it is possible to do this manually by launching app script code using the 'Deploy a script as a web app' option from the Script Editor https://developers.google.com/apps-script/guides/web#deploy_a_script_as_a_web_app我可以看到可以通过使用脚本编辑器https://developers.google.com/apps-script/guides/web#deploy_a_script_as_app_web_web_deploy_a_script_as_a_web_deploy_a_script_as_a_web

Is it possible to automate this in app-script so that the user can configure this in the add-on UI only and in the background, app-script launches the endpoint and can return the endpoint URL to the user?是否可以在 app-script 中自动执行此操作,以便用户只能在附加 UI 中进行配置,并且在后台,app-script 会启动端点并将端点 URL 返回给用户?

It might be possible but you'll likely need the user to grant your app access to restricted scopes, in which case your add-on will need to undergo a security assessment which will run you anywhere from $15,000.00 to $75,000.00.这可能是可能的,但您可能需要用户授予您的应用访问受限范围的权限,在这种情况下,您的附加组件将需要接受安全评估,该评估将使您从 15,000.00 美元到 75,000.00 美元不等。

You can try leveraging the Apps Script API to create a script project specific to the user and use that project to deploy a web app on their behalf.您可以尝试利用 Apps 脚本 API 创建特定于用户的脚本项目,并使用该项目代表他们部署 web 应用程序。 Not sure if it will work, but you can try playing with the following API endpoints:不确定它是否有效,但您可以尝试使用以下 API 端点:

A Google sheets add-on is a single project shared across all users of the add-on. Google 表格插件是在插件的所有用户之间共享的单个项目。 So, even if any user was allowed to use "Deploy as webapp" feature, Deploying it will create a single endpoint for all users of the addon and NOT a unique url endpoint for each user.因此,即使允许任何用户使用“部署为 webapp”功能,部署它也会为插件的所有用户创建一个端点,而不是为每个用户创建一个唯一的 url 端点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM