Search code examples
javagoogle-drive-apigoogle-drive-android-api

How Can I Get Only The "Shared with me" File In Google Drive


I'd like to retrieve the files under the "Shared with me" label, and only those files, to be able to get the newly shared with me files

I noticed that those have no parents, so I can't get them with a files.children request or a files.list request with a q parameter.

I don't want to retrieve all the files then check if they have parent. Is there a way to do it ?


Solution

  • Use the query:

    not '[email protected]' in owners
    

    This will return any files the current user has access to, but is not an owner of the file.