Is there a way to make one call to search for multiple mimeTypes at once? For example, I'm trying to find all mp3 files in a folder. It seems like you need to make a call for each individual mimeType to find all the different ones, similar to this:
https://www.googleapis.com/drive/v2/files?key=aaamykeyaaa&q=mimeType='audio/mpeg' https://www.googleapis.com/drive/v2/files?key=aaamykeyaaa&q=mimeType='audio/mpeg3' https://www.googleapis.com/drive/v2/files?key=aaamykeyaaa&q=mimeType='audio/mp3'
Is there no way to include multiple mimeTypes in one query? It's very inefficient to do it this way.
Thanks.
Yes you can, like this:
(mimeType = 'audio/mpeg' or mimeType = 'audio/mpeg3' or mimeType = 'audio/mp3')
The deprecated Documents List API has that where you just set "type:audio" in the query. I can't find something similar in the Drive API, but you can try using some undocumented search features:
I think they are undocumented because they don't index well. If the user has lots of files, you might need to paginate through a lot of pages with empty items before you get results. You might also get more rate limiting errors if you try to query this way because it is taxing to their servers. It might be more efficient to query each mimeType separately. The Drive API should provide a new operator (like startswith) or a new parameter for these kinds of queries (similar to the Documents List API).
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