gpt4 book ai didi

google-api - 如何调用 Google API

转载 作者:行者123 更新时间:2023-12-02 02:12:25 27 4
gpt4 key购买 nike

我在谷歌上阅读了以下两页:
1) https://developers.google.com/google-apps/documents-list/#getting_a_list_of_documents_and_files

2) https://developers.google.com/accounts/docs/OAuth2WebServer

我可以在后续的 Google API 调用中使用 access_token (OAuth2)(我想调用 Google Docs Listing 或 Google Drive)。

我想使用 curl 或类似的东西,只是形成我的 https URL。
- 因此,在第 1 个文档中,要形成一个 URL,如下所示:
https://docs.google.com/feeds/default/private/full
- 在第二个文档中,示例声明使用类似 https://www.googleapis.com/oauth2/v1/userinfo?access_token=xxxxx 的内容
(将访问 token 添加到调用中)

几个问题
- 我应该调用 googleapis.com 还是 docs.google.com?
- 我可以调用 https://docs.google.com/feeds/default/private/full?access_token=xxxxx
只需将访问 token 添加到调用中?

谢谢

最佳答案

第一次使用 Google API 时需要付出一些努力,但接下来就很简单了:

  • 手工准备 (一次性操作):登录 Google,创建项目,启用相关 API,创建新的 Cient ID。
  • 获取 OAuth 代码、刷新 token 和访问 token (一次性 Action )。
  • 进行 API 调用 (重复的任意 Action )。

  • 下面是整个过程的详细解释- Steps to make a Google API call .
    还可以在此处查看基于 Google Calendar API 的实用示例,并在单个 HTML 文件中提供完整的演示代码 - Easy and compact access to my Google calendars .

    关于google-api - 如何调用 Google API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12169281/

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