【问题标题】:How can I list the contents of a folder inside sharedwithme using google drive api?如何使用 google drive api 列出 sharedwithme 中文件夹的内容?
【发布时间】:2017-08-03 07:04:49
【问题描述】:

我正在尝试使用 API v2 (https://developers.google.com/drive/v2/web/search-parameters) 列出谷歌驱动器下文件夹的内容,但我似乎不知道如何去做。

我正在尝试:

    gapi.client.drive.files.list({
      'maxResults': 50,
      'q': '<ID OF FOLDER> in sharedWithMe'
    })

查询无效。

要输出 sharedWithMe 文件夹,我可以这样做...

    gapi.client.drive.files.list({
      'maxResults': 50,
      'q': 'sharedWithMe'
    })

它有效,但我只想显示与我共享的一个文件夹的内容。 (0Bwfn1xwP3jS_b2VlRUp4SjcwOGc) 是这个文件夹的id。

【问题讨论】:

    标签: javascript google-api google-drive-api drive


    【解决方案1】:

    我发现答案是将 id 括在 "" 中并在 parent 中列出。

    例如

        gapi.client.drive.files.list({
          'maxResults': 100,
          'q': '"<ID OF FOLDER>" in parents'
        })
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多