如何获取 Google 驱动器中目录的条目列表?

How to get a list of entries for a directory in Google Drive?

我正在迁移到 Google Drive REST API(Android SDK v3),但我不知道如何为 [=22= 请求文件系统条目] 假设我有它的驱动器目录 fileId.

我查看了 REST API,但我看不出如何通过 fileId。 貌似可以用search("%fileId%" in parents),但实际上是推荐的方式吗? 有什么正确的方法吗?

在 v2 中有 Children resource, which you could use to list a folder's children (there was also the Parents resource, which you could use to list a file's parents). Because this resources functionalities could be achieved with Files: list, they were dropped in v3

因此在 v3 中,列出文件夹中文件的方法是使用 search query,如您所说,如 q: 'your-folder-id' in parents

如果您想将所有文件和文件夹包含在子文件夹中,请参阅 Tanaike 引用的

参考: