2015-08-26 167 views
11

我需要創建一個文件並將其共享給JS應用程序中同一個域中的所有用戶。Google Drive API文件搜索

下面是創建請求體:

{title: documentName, mimeType: "application/vnd.google-apps.spreadsheet"}

比我加入域的權限創建的文件。

權限插入請求體:

{ "role": "writer","type": "domain","value": domain}

結果在驅動器:
enter image description here

一切工作正常,創建該文件的用戶,我可以找到{q:"title='"+documentName+"' and trashed=false"}文件。

但我找不到與其他用戶的文件。

我試圖sharedWithMe文件夾看:

{q:"title='"+that._documentName+"' and trashed=false and sharedWithMe=true"}- 沒有結果

我基本上需要尋找這樣的:enter image description here

但我找不到任何在驅動器相關source:domain蜜蜂。

+0

是什麼[標籤:谷歌的Chrome擴展]與此有關?搶先刪除標籤,但如果可以解釋,請隨時添加。 – Xan

+0

我覺得這個問題試圖解決同樣的問題,但是他們也沒有找到正式的答案。其他評論者說相同:http://stackoverflow.com/questions/20982992/searching-for-shared-domain-documents-using-google-drive-api – busse

回答

0

我遇到過有人仍然在尋找這個,生病發布答案。 溶液很簡單,只需要corpus集中添加查詢參數DOMAIN,像這樣:{q:"title='"+that._documentName+"' and trashed=false", corpus:"DOMAIN"}

0

我會嘗試以下方法:設置文件的所有者和刪除sharedWithMe(畢竟它明確地與域共享,而不是與特定用戶):

{Q:「標題='」 +那._documentName +「'和'」+車主+「'車主和trashed = false」}