简体   繁体   English

谷歌驱动器 API:如何找到我与他人共享的所有文件

[英]Google drive API : How to find all files I shared with others

I am using drive api v3 to look for files I hare shared with others (anyone),to list them & potentially cancel sharing them.我正在使用驱动器 api v3 来查找我与他人(任何人)共享的文件,列出它们并可能取消共享它们。 I know that in the search box you can do a 'to:' and it will retrieve these files, but I could not use such thing on the API.我知道在搜索框中你可以做一个'to:'它会检索这些文件,但我不能在 API 上使用这样的东西。 my current tri;我现在的三人;

query="'me' in owners and trashed=false and not mimeType = 'application/vnd.google-apps.folder' and visibility != 'limited'"

Thanks in advance提前致谢

As tanaike said, a workaround that solves the problem is by looping through the files using files.list() function, and including id, owners, permissions in the fields.正如tanaike所说,解决问题的一种解决方法是使用 files.list() function 遍历文件,并在字段中包括 id、所有者、权限。 This is going to return a list of objects, and from there we can check if type is anyone .这将返回一个对象列表,从那里我们可以检查type是否为anyone From there, we can also check for attributes like shared:true & ownedByMe:true .从那里,我们还可以检查shared:trueownedByMe:true等属性。

This is just a workaround, and surely not the best solution, since with Drive search, we can do all this by typing to: , which lists all owr shared files.这只是一种解决方法,而且肯定不是最好的解决方案,因为使用 Drive 搜索,我们可以通过键入to:来完成所有这些操作,其中列出了所有 owr 共享文件。 I hope we get an API for this.我希望我们为此获得 API。

Thanks again tanaike再次感谢tanaike

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何列出我使用Google Drive API公开共享的文件? - How do I list files publicly shared by me using google drive API? 如何使用Google Drive API v3上传到Python中的共享驱动器? - How do I upload to a shared drive in Python with Google Drive API v3? 如何使用google drive api获取google drive中所有文件的名称? - How to fetch name of all files in google drive using google drive api? Google Drive API - 列出我尚未访问的共享文件夹中的文件 - Google Drive API - List files in a shared folder that I have not accessed yet 使用 PyDrive 列出共享的 Google Team Drive 文件夹中的所有文件 - List all files in folder in shared Google Team Drive using PyDrive Google Drive API 看不到共享文件夹中的文件 - Google Drive API Cannot See Files in Shared Folder Google Drive API如何找到文件的路径? - Google Drive API How can I find the path of a file? 使用共享设备和服务帐户获取文件夹和文件 Google Drive API - Get folder and files Google Drive API with Shared Device and Service Account 如何使用 Google Drive API 通过服务帐户访问域中的共享文件? - How to get access to shared files in a domain with a service account using the Google Drive API? Google Drive API:如何从Google Drive下载文件? - Google Drive API:How to download files from google drive?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM