Search code examples
apirestgoogle-drive-apigoogle-oauthgoogle-docs-api

How to exclude trashed files when listing files in google drive


I want to list all the files in google drive using google drive api v2 . But I want to exclude files in trash in the list

So I tried

GET https://www.googleapis.com/drive/v2/files?trashed=false

as suggested in the api documentation But still I get files in the trash folder ,Am I missing something ? Or is it a known bug in drive api?


Solution

  • Problem was with query syntax, proper query parameter was

    GET https://www.googleapis.com/drive/v2/files?q=trashed%3Dfalse