snnlankrdsm
snnlankrdsm

Reputation: 1401

Is there a way to query for specific folder in Google drive API?

I want to retrieve all the files from a specific folder. Below code gives me all the files in my drive account.

$files = $service->files->listFiles($parameters);

Is there a way to query only a specific folder name?

Upvotes: 1

Views: 584

Answers (1)

Rivero
Rivero

Reputation: 914

I see that you are implementing with PHP. You can refer to the 'Children' resource, using the list method to show all the children within the folder you are looking for. Keep in mind that you will need the folder's id in order to list its content.

The code should be something like: $children = $service->children->listChildren($folderId, $parameters);

You can find more information about this on: https://developers.google.com/drive/v2/reference/children/list

Upvotes: 1

Related Questions