Google Drive Api - 获取文件夹路径

Nic*_*ick 6 google-api google-drive-api

我目前正在使用Google Drive API来获取文件夹(或子文件夹)列表.为此,我使用以下URL:

https://www.googleapis.com/drive/v2/files/1234folderid1234/children?key=1234APIKEY1234&q=mimeType='application/vnd.google-apps.folder';
Run Code Online (Sandbox Code Playgroud)

这会按预期返回文件夹列表,但是,我还需要文件夹的名称或完整的文件夹路径.此调用不会返回此信息.有没有办法在一次调用中获取具有关联文件夹名称或路径的文件夹列表?

谢谢

Ali*_*har 8

你需要做两件事:

  1. 使用files.list(提供完整的文件资源)
  2. 修改您的查询以添加要搜索的父ID.

    mimeType = 'application/vnd.google-apps.folder' and 'folderId' in parents