列出Google Drive v3文件夹中的文件 [英] List files in folder with Google Drive v3

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

问题描述

我想使用Google驱动器api v3列出Google驱动器文件夹中的所有文件.我已经有了文件夹ID,所以我需要按ID获取文件夹,然后列出其文件.(稍后获取文件信息)问题是api doc仅显示文件的api调用,而不显示文件夹的api调用.请参见 https://developers.google.com/drive/api/v3/reference

I want to list all files in a Google drive Folder with Google drive api v3. I have the Folder id already so i Need to get the Folder by id and then list its files. (and get file Information further on later) The Problem is the api doc just Shows api calls for files but not for Folders. See https://developers.google.com/drive/api/v3/reference

不能再在v3中完成吗?如果我没记错的话,v2提供了这样的调用,但是我想我不应该再使用v2,因为它将在不久的将来被弃用,不是吗?

Can't that be done in v3 anymore? v2 offers such calls if i remember correctly but i suppose i shouldn't use v2 anymore because it will be deprecated in near future, won't it?

该文件夹是公共的

推荐答案

以Raserhin所说的为基础,列出特定的文件夹ID:

To build on what Raserhin said, to list for a specific folder id:

q='folderid' in parents
q='1eWTOT0KUZiDko-A0JsLCqbhTJ3oOMJ6Wb' in parents

完整的HTTP请求:

GET https://www.googleapis.com/drive/v3/files?q=%22folderid%22%20in%20parents&key=[YOUR_API_KEY]

这篇关于列出Google Drive v3文件夹中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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