1
votes

In my iOS app, when I execute "queryForFilesList" with q="" I get a list of all files and folders on my Google Drive plus shared root folders, but not the files in the shared root folders. If I use Chrome to show shared folders and click on a shared folder, the files in that shared folder are shown correctly. If the owner subsequently adds another file to the folder he is sharing with me, that file then appears in the list of files obtained by the above query. So, the list that is returned seems to depend on "when" the file was shared rather than "if" the file was shared. I think this is a bug so I need a work around. Obviously Chrome is using the work around. Executing the query using Google's "try it now" produces the same result. I've tried using "children.list" with no luck; sharedWithMe with folderId=root returns nothing. Is there an alias for the shared root?

However, while composing this question, I think I discovered a work around. If you use the id of the shared root folder (say 'xyz') and execute a "queryForFilesList" with q='xyz' in parents, all the files in the folder with id=xyz are returned as expected.

2
According to the FAQ, it's OK to post an answer to your own question. You may have to wait a few minutes, but it's a good way to help others who have the same problem.Dan Pichelman
(no need to wait a few minutes, and answering your own question is actually encouraged)Franck Dernoncourt

2 Answers

0
votes

sharedWithMe query will not return the files under the shared folders, it only returns individually shared files and folders.

You can additionally query for '<sharedFoldersId>' in parents to list all of the files under a shared folder.

0
votes

It's not the best practice, but you can use a following query in list reuest to list most of the shared to you files including children and shared by links files and folders, that were viewed by You.

https://www.googleapis.com/drive/v2/files?q=not+'{your_email_address}'+in+owners