[英]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:true
和ownedByMe: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。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.