2012-09-04 49 views
4

當我通過網絡查看時,我在「與我共享」文件夾中有四個文件:file1,file2,file3,fil4。我不擁有它們(我只能寫/ reade)。我嘗試使用file.list方法使用參數 q ='not(myId)in owners'來獲取它們。 之後,結果只包含四個文件1中的一個項目。當我做 q ='不是(myId)所有者'和標題='文件2' 之後,結果只包含一個項目file2。有人可以告訴我爲什麼?或者如何以其他方式列出它們?如何通過新的谷歌驅動器API列出「與我共享」項目?

UPDATE。過了一段時間"q = not 'me' in owner"返回空數組(下面的"q = not 'me' in owners and title = 'File Name'"

{ 
"kind": "drive#fileList", 
"etag": "\"dTUgP0s1WO8T7wOSfuvve0A4d_k/7dZrNXLata7h1mdbx2RHkqdePEM\"", 
"selfLink": "https://www.googleapis.com/drive/v2/files?q=not+'me'+in+owners+and+title+%3D+'File+Name'", 
"items": [ 
    { 

    "kind": "drive#file", 
    "id": "1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY", 
    "etag": "\"dTUgP0s1WO8T7wOSfuvve0A4d_k/MTM0MjE4MDUzNjUyNg\"", 
    "selfLink": "https://www.googleapis.com/drive/v2/files/1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY", 
    "alternateLink": "https://docs.google.com/a/readdle.com/document/d/1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY/edit", 
    "embedLink": "https://docs.google.com/a/readdle.com/document/d/1L8lfBYZHV59uUVpFspFdeW4Sa5JB7eo3CgPe59kpNCmY/preview", 
    "thumbnailLink": "https://docs.google.com/feeds/vt?gd=true&id=1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY&v=270&s=AMedNnoAAAAAUE-eryR5NIqdEWR3A7bza730sDHhziBH&sz=s220", 
    "title": "File Name", 
    "mimeType": "application/vnd.google-apps.document", 
    "labels": { 
    "starred": false, 
    "hidden": false, 
    "trashed": false, 
    "restricted": false, 
    "viewed": true 
    }, 
    "createdDate": "2012-03-19T08:37:26.636Z", 
    "modifiedDate": "2012-07-13T11:55:36.526Z", 
    "modifiedByMeDate": "2012-05-11T13:02:10.901Z", 
    "lastViewedByMeDate": "2012-09-04T14:44:32.193Z", 
    "sharedWithMeDate": "2012-05-11T10:15:44.221Z", 
    "parents": [ 
    ], 
    "exportLinks": { 
    "application/vnd.oasis.opendocument.text": "https://docs.google.com/feeds/download/documents/export/Export?id=1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY&exportFormat=odt", 
    "application/msword": "https://docs.google.com/feeds/download/documents/export/Export?id=1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY&exportFormat=doc", 
    "text/html": "https://docs.google.com/feeds/download/documents/export/Export?id=1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY&exportFormat=html", 
    "application/rtf": "https://docs.google.com/feeds/download/documents/export/Export?id=1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY&exportFormat=rtf", 
    "text/plain": "https://docs.google.com/feeds/download/documents/export/Export?id=1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY&exportFormat=txt", 
    "application/pdf": "https://docs.google.com/feeds/download/documents/export/Export?id=1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY&exportFormat=pdf" 
    }, 
    "userPermission": { 
    "kind": "drive#permission", 
    "etag": "\"dTUgP0s1WO8T7wOSfuvve0A4d_k/b2rD7cIZxsGVuxg2MbXoc17PSQU\"", 
    "id": "me", 
    "selfLink": "https://www.googleapis.com/drive/v2/files/1L8lfBYZHV59uUVpFspFdeW4SaJB7eo3CgPe59kpNCmY/permissions/me", 
    "role": "writer", 
    "type": "user" 
    }, 
    "quotaBytesUsed": "0", 
    "ownerNames": [ 
    "Owner Name" 
    ], 
    "lastModifyingUserName": "Owner Name", 
    "editable": true, 
    "writersCanShare": true 
    } 
] 
} 

回答

0

它看起來像現在一切都很好。我可以在所有者中看到所有與我共享的文件,其中q =不是「我」。因此,答案是「谷歌沒有與他們的谷歌驅動API一些工作」)

感謝所有誰幫我明白

0

結果。這是不完全正確的,你已經創建的文件並不意味着你不是一個所有者,所有者權限可能已添加爲你文件

查詢應該工作:

q=not '[email protected]' in owners 
+0

我已經更新了這個問題,請大家看看 – UIBuilder

1

這是一個有趣的問題:-)

「當我? do q ='not(myId)in owner'and title ='file2'之後,結果只包含一個項目file2。「

+0

你說得對。這是谷歌的伎倆。我應該得到**所有4個文件,包括file2 **,q ='不是所有者',因爲我得到file2,其中q ='not(myId)in owner'和title ='file2'。我對嗎? – UIBuilder

+0

我的歉意,你的問題在翻譯中迷失了。你的意思是 q ='not(myId)在所有者'和title ='file2'中返回file2,但是q ='不是我在所有者返回時只返回file1?我可以重新創建這些症狀的唯一方法是在查詢中包含maxresults = 1。 您是否嘗試過使用https://developers.google.com/drive/v2/reference/files/list#try-it 在線進行查詢當我嘗試它時,我得到預期結果 – pinoyyid

+0

謝謝,但我嘗試它與谷歌控制檯和內部的代碼,並有相同的錯誤結果(。所以我認爲這發生在以前創建的非「谷歌驅動器文件」 – UIBuilder

4

Q = sharedWithMe也應該返回文件的所有與您共享的列表。

+0

謝謝answer..listrequest.Q =「sharedWithMe」; – Toprak

相關問題