根据
API documentation,你可以像’trashed’一样在’sharedWithMe’上搜索:
trashed boolean =, != Whether the file is in the trash or not.
sharedWithMe boolean =, != Files that have been shared with the authorized user.
像“trashed”,“not trashed”和“trashed = false”这样的查询都按预期工作. “sharedWithMe”也有效.
但是,什么不起作用是“not sharedWithMe”或“sharedWithMe = false”.什么是正确的语法或这是一个错误?
示例:q = not sharedWithMe
错误:
"domain": "global",
"reason": "invalid",
"message": "Invalid Value",
"locationType": "parameter",
"location": "q"
最佳答案 我也相信这个问题是google drive API实现中的一个错误.
我正在解决这个问题(在python中)使用“sharedWithMeTime”
我从每个列表请求中返回的属性.
我收回所有项目后(sharedWithMe与否),
然后,我测试每个项目中是否存在sharedWithMeTime属性.
如果没有,那么该项必须是“not sharedWithMe”,这是我想要使用的
作为查询,但是得到了OP描述的错误.
链接到列表请求上的python doc是:
https://developers.google.com/resources/api-libraries/documentation/drive/v3/python/latest/drive_v3.files.html#list