Google Drive Api - 获取文件夹路径 [英] Google Drive Api - Get Folder Paths
问题描述
我目前使用Google Drive API来获取文件夹(或子文件夹)的列表。为了做到这一点,我使用以下网址:
https://www.googleapis.com/drive/v2/files /1234folderid1234/children?key=1234APIKEY1234&q=mimeType='application/vnd.google-apps.folder';
这将按照预期返回文件夹列表,但是,我也需要文件夹或完整文件夹路径。此通知不会返回此信息。有没有办法在一次调用中获取文件夹名称或路径的文件夹列表?
谢谢
- 使用解决方案
/developers.google.com/drive/v2/reference/files/list\">files.list (提供完整的文件资源)
修改您的查询添加您要搜索的父级ID。
父母的mimeType ='application / vnd.google-apps.folder'和'folderId'
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
You need to do two things:
- Use files.list (which gives full file resources)
Amend your query to add the parent id you want to search in.
mimeType = 'application/vnd.google-apps.folder' and 'folderId' in parents
这篇关于Google Drive Api - 获取文件夹路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!