3
votes

I'm trying to get list of files and folders in My Drive via this endpoint

https://www.googleapis.com/drive/v3/files

but the result returned is all my files (not same with My Drive).

Can I get correct list of resources like Outlook app ?

Regards,

Solution To get items list in "My Drive", I have to pass this query in the request

q='root' in parents

1
Not sure i understand the question. googleapis.com/drive/v3/files will return all the files on the authencated users google drive account.DaImTo
I want to retrieve a list of file and folder like My Drive :)haithngn
not exactly sure what you mean by My Drive the API is just going to return a list of stringsDaImTo
@DaImTo, sorry about my explanation. I just want to get the current File/Folder in My Drive folder. The current endpoint always returns all my drive's fileshaithngn
@haithngn q='root' working fine?Dixit Akabari

1 Answers

1
votes

I just want to get the current File/Folder in My Drive folder. The current endpoint always returns all my drive's files

The Google Drive API just returns a list of files. It has no concept of what your current file/folder is. you can use the Q param to just return files within a specific folder, but you are going to have to know the name of the folder you want to list the files from.