Query for list of files and folders in root directory

后端 未结 3 1466
我寻月下人不归
我寻月下人不归 2021-02-05 14:46

I would like to get a list of files and folders in the root directory without having to sort through all the files. Is there a query that would do this?

3条回答
  •  臣服心动
    2021-02-05 15:15

    The root folder can also be addressed with a special alias named "root", so you can get all files and folders in the root with the following query:

    https://www.googleapis.com/drive/v2/files?q='root' in parents
    

    Remember to escape the URL if not using one of the client libraries (they automatically take care of it).

    For more details about the search query language, check https://developers.google.com/drive/search-parameters

提交回复
热议问题