google-sheets - 在没有客户端登录的情况下使用 google sheet api

标签 google-sheets google-spreadsheet-api

我有一个从 Google 电子表格中获取数据的网站。我希望我的用户在不登录的情况下查看获取的数据。这可能吗?怎么做?

为了获取和更新工作表数据,我只需要一个帐户,最好在服务器端登录。但是,我没有看到任何不需要客户端登录的服务器端日志记录。

最佳答案

基于此link ,当您的应用程序请求公共(public)数据时,该请求不需要授权,但需要伴随标识符,例如 API key 。

Every request your application sends to the Google Sheets API needs to identify your application to Google. There are two ways to identify your application: using an OAuth 2.0 token (which also authorizes the request) and/or using the application's API key. Here's how to determine which of those options to use:

  • If the request requires authorization (such as a request for an individual's private data), then the application must provide an OAuth 2.0 token with the request. The application may also provide the API key, but it doesn't have to.
  • If the request doesn't require authorization (such as a request for public data), then the application must provide either the API key or an OAuth 2.0 token, or both—whatever option is most convenient for you.


以下是可能有帮助的其他引用:
  • Google Sheets API: client side 'service account' authorization
  • Access Google spreadsheet API without auth token
  • Write to a Google spreadsheet from JavaScript using the Public API access (no OAuth)
  • 关于google-sheets - 在没有客户端登录的情况下使用 google sheet api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51081462/

    相关文章:

    google-sheets - 是否可以自动化 Google 电子表格脚本(例如,无需事件来触发它们)?

    google-apps-script - 使用 MailApp.sendEmail 谷歌表格防止文本换行?谷歌脚本

    regex - 如果单元格包含特定文本,则返回特定的下拉列表项(Google 表格)

    google-apps-script - 如果 A 列为空,隐藏 Google 电子表格中的行吗?

    python - 使用 Google API v4 添加带有数据的 Google 表格

    charts - 谷歌电子表格图表中的命名范围?

    grails 设计类和外部数据(电子表格)

    google-sheets - 在谷歌表格中提取特定标准中的最早日期

    java - 使用 Java 的 OAuth 2.0 和 Google Spreadsheet API 的示例是什么?

    PHP Google Sheets API 快速启动问题