简体   繁体   English

通过 API 密钥和 Javascript 使用 Google Apps Script Execution API

[英]Use Google Apps Script Execution API with API keys and Javascript

I want to create a web application for my client and use Google drive to store information.我想为我的客户创建一个 Web 应用程序并使用 Google Drive 来存储信息。 Since it's impossibe to integrate a web application from google apps script in my own website I try to use Google Apps Script Execution API and Javascript to make the interaction between my website and Google Drive.由于不可能在我自己的网站中集成来自 google apps 脚本的 web 应用程序,因此我尝试使用 Google Apps Script Execution API 和 Javascript 在我的网站和 Google Drive 之间进行交互。

I find out some exemple like this one : https://mashe.hawksey.info/2015/10/google-sheets-as-a-database-authenticated-insert-with-apps-script-using-execution-api/ I do be able to reproduce this example but it use an Auth authentification.我找到了一些这样的例子: https : //mashe.hawksey.info/2015/10/google-sheets-as-a-database-authenticated-insert-with-apps-script-using-execution-api/我确实能够重现此示例,但它使用 Auth 身份验证。

I would like to use Google Apps Script Execution API without Auth authentification but with simple API keys.我想使用 Google Apps Script Execution API,无需身份验证,但使用简单的 API 密钥。

Is it possible ?是否可以 ? And do you have an example to illustrate this.你有没有例子来说明这一点。

Thank you for your help,感谢您的帮助,

Yes you can do that.是的,你可以这样做。 Check this guide about web deployment using apps script .查看有关使用应用程序脚本进行 Web 部署的指南 You just need to run the web app as your own user (parameter Execute the app as ).您只需要以您自己的用户身份运行 Web 应用程序(参数Execute the app as )。 But you will only be able to get access to your own google Drive which may not be that useful.但是您将只能访问您自己的谷歌云端硬盘,这可能不是那么有用。 If you want to access others' people Drive then you must run the web app as the current user but this will prompt for permissions (the first time the user access your application).如果您想访问其他人的 Drive,那么您必须以当前用户身份运行 Web 应用程序,但这会提示您提供权限(用户第一次访问您的应用程序时)。

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

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