According to the API documentation you can search on 'sharedWithMe' in the same way as 'trashed':
trashed boolean =, != Whether the file is in the trash or not.
sharedWithMe boolean =, != Files that have been shared with the authorized user.
Queries like "trashed", "not trashed" and "trashed=false" all work as expected. Also "sharedWithMe" works.
However whats does not work is "not sharedWithMe" or "sharedWithMe=false". What is the right syntax or is this a bug?
Example: q=not+sharedWithMe
Error:
"domain": "global",
"reason": "invalid",
"message": "Invalid Value",
"locationType": "parameter",
"location": "q"
Search by the file's creator In the shared drive search box, enter creator: followed by the email of the person in your organization who created the file. For example, creator:[email protected]. and add more search operators. Press Enter.
I also believe this problem is a bug in the google drive API implementation.
I am working around this problem (in python) by using the "sharedWithMeTime" attribute that I get back from each list request. After I get back all the items (sharedWithMe or not), I then test for whether sharedWithMeTime attribute exists in each item. If not, then the item must be "not sharedWithMe", which is what I wanted to use as the query, but was getting the error described by the OP.
Link to the python doc on list request is here: https://developers.google.com/resources/api-libraries/documentation/drive/v3/python/latest/drive_v3.files.html#list
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With