gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 19:44:24 31 4
gpt4 key购买 nike

我有一个从 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/

    31 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com