Excluding specific mimeType from Google Drive API results

339 views Asked by At

I'm using hello.js and retrieving a list of the users files via javascript, but I want to be able to exclude specific mimetypes from the results that are sent back.

https://www.googleapis.com/drive/v2/files?q=%22root%22+in+parents+and+trashed=false&maxResults=100&access_token=<access_token>

Is there a query param that can be added to exclude results like Maps?

1

There are 1 answers

1
Drew On BEST ANSWER

In the following example the mimeType "image/png" is excluded.

function getImages() {
   var gl = hello('google');
   gl.login({scope:'files'}).then(function(){

       // Make request for files add the proprietary parameter 'q'
       // See https://developers.google.com/drive/web/search-parameters for more.
       return gl.api("me/files", {q:"mimeType != 'image/'"});
   }).then(log.bind(null,'.demo2'),log.bind(null,'.demo2'));
}