如何使用 Google Drive API 获取文件的所有者 [英] How to get the owner of file using Google Drive API

查看:20
本文介绍了如何使用 Google Drive API 获取文件的所有者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑开发这样的应用程序:

I am thinking of developing an application like this:

  1. 我的应用程序有一个 google-service-account
  2. 我让我的用户与我的服务帐户共享他们的文档
  3. 当用户访问我的应用程序时,他会根据他共享的文件获得一些报告.

为此,我的应用程序需要唯一标识与其共享的文档的所有者.我查看了 API,但找不到如何执行此操作.我找到了 File.getOwnerNames(),但它们是包含名称的纯字符串,但不是用于识别用户的任何唯一键.

For this, my application needs to uniquely identify the owner of the documents shared with it. I looked at the API but could not find how to do so. I found methods like File.getOwnerNames(), but they are plain strings containing the names, but not any unique key to identify the user.

需要有关如何实现此目的的帮助.谢谢.

Need help on how to achieve this. Thanks.

桑杰

推荐答案

使用 permissions.list 方法并找到所有者对应的权限.

Use the permissions.list method and find the permission corresponding to the owner.

这篇关于如何使用 Google Drive API 获取文件的所有者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆