仍然可以使用 Google 日历 API 和 API 键吗?
Still possible to use Google Calendar API with API Key?
似乎 Google 日历 API 的当前版本是 v3,我相信它在过去支持 OAuth 和简单的 API 密钥 JavaScript/Browser实施。
截至 2017 年 2 月 2 日:是否仍可以使用 Google 日历 API 和 API 密钥,或者是否需要任何访问权限(甚至访问public 日历)到 API 通过 OAuth2.0?
根据 Google 日历 API、"Your application must use OAuth 2.0 to authorize requests" (https://developers.google.com/google-apps/calendar/auth),但我的 API 请求正在打开 public 日历并且不需要登录,因为 none 数据是私有的。
好吧,看来 Google 日历现在需要授权令牌才能访问它自己的 API。在他们的 documentation 中声明,您的应用程序发送到 Google 日历 API 的每个请求都必须包含授权令牌。该令牌还可以将您的应用程序标识为 Google.
我在此 question 中发现您无法使用 API 密钥访问您的日历信息。 API 密钥(或简单的 API 访问密钥)不是授权令牌,只能用于某些 API 调用,例如 Google 搜索查询等; API 密钥不会让您访问任何用户特定数据,我假设这是您通过此日历应用程序 objective。
我尝试使用 API 键访问 Google 日历请求,但出现错误 401 "Login Required"
https://www.googleapis.com/calendar/v3/users/me/calendarList/primary?key=YOUR_API_KEY
为了验证 API_KEY 是问题所在,我尝试在 Google 地图请求中使用它。
https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap
我在这里得到了成功的回应。
希望这些信息对您有所帮助。
您可以使用 GET 方法和 url:
访问日历事件列表
https://www.googleapis.com/calendar/v3/calendars/[CALENDAR_PUBLIC_ID]/events&key=[YOUR_API_KEY]
您还可以根据文档添加更多查询参数,如 maxResult、orderBy 等 https://developers.google.com/calendar/api/v3/reference/events/list
似乎 Google 日历 API 的当前版本是 v3,我相信它在过去支持 OAuth 和简单的 API 密钥 JavaScript/Browser实施。
截至 2017 年 2 月 2 日:是否仍可以使用 Google 日历 API 和 API 密钥,或者是否需要任何访问权限(甚至访问public 日历)到 API 通过 OAuth2.0?
根据 Google 日历 API、"Your application must use OAuth 2.0 to authorize requests" (https://developers.google.com/google-apps/calendar/auth),但我的 API 请求正在打开 public 日历并且不需要登录,因为 none 数据是私有的。
好吧,看来 Google 日历现在需要授权令牌才能访问它自己的 API。在他们的 documentation 中声明,您的应用程序发送到 Google 日历 API 的每个请求都必须包含授权令牌。该令牌还可以将您的应用程序标识为 Google.
我在此 question 中发现您无法使用 API 密钥访问您的日历信息。 API 密钥(或简单的 API 访问密钥)不是授权令牌,只能用于某些 API 调用,例如 Google 搜索查询等; API 密钥不会让您访问任何用户特定数据,我假设这是您通过此日历应用程序 objective。
我尝试使用 API 键访问 Google 日历请求,但出现错误 401 "Login Required"
https://www.googleapis.com/calendar/v3/users/me/calendarList/primary?key=YOUR_API_KEY
为了验证 API_KEY 是问题所在,我尝试在 Google 地图请求中使用它。
https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap
我在这里得到了成功的回应。
希望这些信息对您有所帮助。
您可以使用 GET 方法和 url:
访问日历事件列表https://www.googleapis.com/calendar/v3/calendars/[CALENDAR_PUBLIC_ID]/events&key=[YOUR_API_KEY]
您还可以根据文档添加更多查询参数,如 maxResult、orderBy 等 https://developers.google.com/calendar/api/v3/reference/events/list