Getting a list of files by folder on Drive SDK

NB This answer uses the v2 API. New applications should write to the v3 API.

It is now possible to use the drive.files.list endpoint to list files belonging to a specific folder.

To do so, you can use the ?q= query parameter as follows:

GET https://www.googleapis.com/drive/v2/files?q="'<FOLDER_ID>' in parents"

In PHP, that would be

$service->files->list(array('q' => "'<FOLDER_ID>' in parents"));

Leave a Comment