Google Drive Api - Get Folder Paths

混江龙づ霸主 提交于 2019-12-21 12:36:50

问题


I'm currently using the Google Drive API to get a list of folders (or subfolders). In order to do this I use the following URL:

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

This returns back a list of the folders as expected, however, I also need either the name of the folder or the full folder path. This information is not returned with this call. Is there a way to get the list of folders with the associated folder name or path in one call?

Thanks


回答1:


You need to do two things:

  1. Use files.list (which gives full file resources)
  2. Amend your query to add the parent id you want to search in.

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



来源:https://stackoverflow.com/questions/13709755/google-drive-api-get-folder-paths

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!