Google Drive API - 查询所拥有的项目

时间:2018-05-17 18:06:21

标签: google-drive-api

我正在开发一个工具,我只想查询自己的文件夹。我无法制定一个被接受的查询字符串。我看过Search for files页面,现在正在尝试使用API​​资源管理器。

  1. 字符串mimeType = 'application/vnd.google-apps.folder'会产生文件夹。好的开始。
  2. ownedByMeownedByMe = trueownedByMe = false都会产生错误400(无效值),而当我在结果集中使用此字段时,会显示
  3. sharedWithMesharedWithMe = truesharedWithMe != false会产生结果,但有趣的是我无法将此字段添加到结果集中,也不会将其包含在字段选择器中。
  4. sharedWithMe = falsenot sharedWithMenot sharedWithMe = truesharedWithMe != true都产生错误400
  5. 我尝试了一些其他不太常见的语法,但现在我没有想法:(

1 个答案:

答案 0 :(得分:0)

在所有者中使用" [我的电子邮件]"或者"'我'在所有者":

  var files = DriveApp.searchFolders("\(mimeType = 'application/vnd.google-apps.folder'\) and \('test@example.org' in owners\)");

  var files = DriveApp.searchFolders("\(mimeType = 'application/vnd.google-apps.folder'\) and \('me' in owners\)");
相关问题