是否可以在未经同意的情况下将 Google 云端硬盘电子表格加载为 JSON?
Possible to load Google Drive spreadsheet as JSON without consent screen?
我正在尝试直接从私人(只有拥有 link 的人可以访问)电子表格向我的网站实施 JSON 提要。我需要使用 OAuth 2.0 生成一个新的身份验证令牌,这很好,但似乎 Google Sheets API v4 需要 "auth" 屏幕。这样,数据要么作为 JSON 加载,要么根本不加载。
是否有任何设置或覆盖我可以设置,这样我就不必有那个讨厌的中间步骤?我不需要访问任何用户文件...只需使用 OAuth 2.0 访问此特定电子表格的提要。
Sheetsv4 Authorize Requests 提到使用 Google 表格时有两种授权请求的方法。他们正在使用 oauth 令牌和 API 密钥:
When your application requests private data, the request must be
authorized by an authenticated user who has access to that data.
When your application requests public data, the request doesn't need
to be authorized, but does need to be accompanied by an identifier,
such as an 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.
我正在尝试直接从私人(只有拥有 link 的人可以访问)电子表格向我的网站实施 JSON 提要。我需要使用 OAuth 2.0 生成一个新的身份验证令牌,这很好,但似乎 Google Sheets API v4 需要 "auth" 屏幕。这样,数据要么作为 JSON 加载,要么根本不加载。 是否有任何设置或覆盖我可以设置,这样我就不必有那个讨厌的中间步骤?我不需要访问任何用户文件...只需使用 OAuth 2.0 访问此特定电子表格的提要。
Sheetsv4 Authorize Requests 提到使用 Google 表格时有两种授权请求的方法。他们正在使用 oauth 令牌和 API 密钥:
When your application requests private data, the request must be authorized by an authenticated user who has access to that data.
When your application requests public data, the request doesn't need to be authorized, but does need to be accompanied by an identifier, such as an 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.