【问题标题】:Getting list of documents related to a particular user in Google Apps using Admin Account使用管理员帐户获取与 Google Apps 中特定用户相关的文档列表
【发布时间】:2015-02-12 10:32:55
【问题描述】:

我正在使用 google apis 创建一个应用程序。我需要使用 google admin 帐户通过 google apis 访问用户的文档。过去我可以像这样使用 google docs api

例如,我是域 iritesh.com 的管理员,我的电子邮件地址是 ritesh@iritesh.com。我使用管理员帐户登录,并且可以使用 user_id = rajat@iritesh 在 rajat@iritesh.com 的谷歌驱动器中检索文档。 com.

https://docs.google.com/feeds/"+user_id+"/private/full/folder:root/contents?v=3&alt=json

但现在 google docs api 已被弃用。任何人都可以请指导如何现在使用 google apis 实现这一点。

链接参考:https://developers.google.com/google-apps/documents-list/#using_google_apps_administrative_access_to_impersonate_other_domain_users

【问题讨论】:

    标签: google-api google-drive-api google-apps google-docs-api google-drive-realtime-api


    【解决方案1】:

    使用新的 API 和 OAuth 2,您可以完成此功能,但为此您必须使用具有域范围委派的服务帐户。

    基本上,使用服务帐户可以模拟域中的用户并代表用户进行 API 调用。要获取有关文档的信息,您将使用 Drive API。

    这是关于服务帐户的文档: https://developers.google.com/accounts/docs/OAuth2ServiceAccount

    和驱动 API: https://developers.google.com/drive/v2/reference/

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-02-16
      • 1970-01-01
      • 1970-01-01
      • 2011-05-17
      • 1970-01-01
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      相关资源
      最近更新 更多