1

Current Dropbox API searchFileNames() allows the searching of a query / substring, so if I wanted to look for filenames in a folder that were of a specific extension such as ".jpg", that works, but if I combine to look for ".jpg .png" I get nothing returned... as the documentation states 'A file matches only if it contains all the substrings.'

Is there another API that will allow a union of the searched vs the exclusion?

Thanks

JMoskwa
  • 21
  • 1
  • 9

1 Answers1

1

No, the Dropbox API doesn't enable you to search for multiple file extensions at once like this, but I'll be sure to pass this along as a feature request.

As a workaround, you can split this into multiple API calls.

Greg
  • 16,359
  • 2
  • 34
  • 44
  • I figured I could add a few API's and iterate through the results and sort them in some meaningful order. That method does present some issues if I'm chunking through a LARGE Dropbox folder for images that I can consume in my app - which are jpeg jpg gif and png image formats. Could this be something that almost anyone would require? – JMoskwa Jun 24 '16 at 23:43
  • I started looking at v2 function "search" it allows the start & max_results so I can limit the amount of items coming back to my client and "chunk" or "iterate" over the items in the Folder. But it seems that I need to have something in the query parameter. As mentioned above, the parameters are inclusive (all need to match), I've tried in the sandbox to put nothing in the query param, but it errors?? The v2 search sandbox is here https://dropbox.github.io/dropbox-api-v2-explorer/#files_search how do I search for ALL? – JMoskwa Jun 29 '16 at 16:07
  • The `query` parameter for [/2/files/search](https://www.dropbox.com/developers/documentation/http/documentation#files-search) is required, so you need to enter a value to search for anything. If you instead want all files, you can use [/2/files/list_folder](https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder) and [/2/files/list_folder/continue](https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-continue). – Greg Jun 29 '16 at 20:10
  • Looking at the list_folder sandbox at https://dropbox.github.io/dropbox-api-v2-explorer/#files_list_folder #1). I find no way to just return just the folders - basically where ".tag" = "folder" - I get all folders and files in one huge hunk the have to parse out the "folders" #2). There is no way to easily parse the nested folders into some logical way so I can display a list with the sub folders indented in a display. such as Parent ID's would be helpful to match up children & parent folders Any help? – JMoskwa Jul 14 '16 at 00:38
  • This sounds like a different question, so it deserves another post. It looks like you have one for this here, so I'll follow up there: https://stackoverflow.com/questions/38405366/dropbox-api-v2-files-list-folder – Greg Jul 16 '16 at 14:36