2016-11-13 84 views
2

按照API documentation你可以以同樣的方式爲「丟棄」上「sharedWithMe」搜索:如何使用Google Drive API v3搜索** not ** sharedWithMe?

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

查詢,如「看不上」,「不丟棄」和「丟棄=假」作爲一切工作的預期。另外「sharedWithMe」的作品。

然而,什麼不起作用是「not sharedWithMe」或「sharedWithMe = false」。什麼是正確的語法,或者這是一個錯誤?

實施例:Q =未+ sharedWithMe

錯誤:

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

渡過了[相同的文檔(https://developers.google.com/drive/v3/web/search-parameters),我注意到'sharedWithMe'字段的'=''和'!=''。所以你的「not sharedWithMe」必須像使用編程一樣使用'!=''。 – noogui

+1

是的,和垃圾一樣。但'sharedWithMe = false'不起作用。我也嘗試過'!sharedWithMe'。沒有運氣。 – rmuller

回答

2

我也相信這個問題是在谷歌驅動API實現中的錯誤。

我正在通過使用從每個列表請求中獲得的「sharedWithMeTime」 屬性來解決此問題(在python中)。 當我找回所有的項目(sharedWithMe或不), 然後我測試每個項目中是否存在sharedWithMeTime屬性。 如果不是,那麼該項目必須是「not sharedWithMe」,這是我想用 作爲查詢,但得到了OP描述的錯誤。

鏈接到列表請求蟒蛇文檔是在這裏: https://developers.google.com/resources/api-libraries/documentation/drive/v3/python/latest/drive_v3.files.html#list

+0

此變通辦法可能仍然存在問題,因爲結果將包括域中任何人都可以看到的文件(無sharedWithMeTime屬性),但也不在「我的雲端硬盤」中。 – MitchN

+0

'ownedByMe'也許是一個難以捉摸的「不sharedWithMe」的體面指標, – MitchN