Google Drive Api - 获取文件夹路径 [英] Google Drive Api - Get Folder Paths

查看:638
本文介绍了Google Drive Api - 获取文件夹路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用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:

    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

    这篇关于Google Drive Api - 获取文件夹路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆