如何使用Google Drive API v3搜索** not ** sharedWithMe? [英] How to search for **not** sharedWithMe with Google Drive API v3?

查看:55
本文介绍了如何使用Google Drive API v3搜索** not ** sharedWithMe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 API文档,您可以搜索"sharedWithMe"以与被破坏"相同的方式:

According to the API documentation you can search on 'sharedWithMe' in the same way as 'trashed':

trashed      boolean    =, !=   Whether the file is in the trash or not.
sharedWithMe boolean    =, !=   Files that have been shared with the authorized user.

已删除",未删除"和"trashed = false"之类的查询均按预期工作."sharedWithMe"也可以使用.

Queries like "trashed", "not trashed" and "trashed=false" all work as expected. Also "sharedWithMe" works.

但是什么是行不通的是"not sharedWithMe"或"sharedWithMe = false".正确的语法是什么,或者这是个错误?

However whats does not work is "not sharedWithMe" or "sharedWithMe=false". What is the right syntax or is this a bug?

示例:q = not + sharedWithMe

Example: q=not+sharedWithMe

错误:

"domain": "global",
"reason": "invalid",
"message": "Invalid Value",
"locationType": "parameter",
"location": "q"

推荐答案

我也认为此问题是Google驱动器API实现中的错误.

I also believe this problem is a bug in the google drive API implementation.

我正在通过使用"sharedWithMeTime"解决此问题(在python中)从每个列表请求中获取的属性.在我取回所有项目(无论是否与sharedWithMe)之后,然后,我测试每个项目中是否存在sharedWithMeTime属性.如果不是,则该项目必须为"not sharedWithMe",这是我想使用的内容作为查询,但出现了OP描述的错误.

I am working around this problem (in python) by using the "sharedWithMeTime" attribute that I get back from each list request. After I get back all the items (sharedWithMe or not), I then test for whether sharedWithMeTime attribute exists in each item. If not, then the item must be "not sharedWithMe", which is what I wanted to use as the query, but was getting the error described by the OP.

链接到列表请求上的python文档的位置在这里: https://developers.google.com/resources/api-libraries/documentation/drive/v3/python/latest/drive_v3.files.html#list

Link to the python doc on list request is here: https://developers.google.com/resources/api-libraries/documentation/drive/v3/python/latest/drive_v3.files.html#list

这篇关于如何使用Google Drive API v3搜索** not ** sharedWithMe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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