Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

RobFearnside's avatar
RobFearnside
New member | Level 2
6 years ago
Solved

Wildcard search

I'm writing an app where I'd like to be able to search for all video/image files in a particular folder.  For example, for the root I was imagining that I'd be able to post something like this to files/search_v2 :

 

{
   "options" : 
{ "file_categories": ["video", "image"] } }

 

but that fails because I haven't supplied a 'query' parameter.  If I supply this :

 

{
   "query" : "*",
   "options" : 
   {
      "file_categories": ["video", "image"]
   }
}

then there are no matches (presumbly because I have no files with an asterisk in the name).

 

Is it possible to search for files (or folders) without having to specify a 'query' (in order to find all files which match the supplied 'options' criteria)? 

 

 

  • No, unfortunately, the Dropbox API doesn't offer the ability to do a wildcard search like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. 

     

    While not ideal, as a workaround, you could list the full contents of the folder using /2/files/list_folder[/continue] and filter based on the file extension.

5 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    No, unfortunately, the Dropbox API doesn't offer the ability to do a wildcard search like this, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. 

     

    While not ideal, as a workaround, you could list the full contents of the folder using /2/files/list_folder[/continue] and filter based on the file extension.

  • George g.'s avatar
    George g.
    New member | Level 2
    5 years ago

    Isn't this the proposed solution for getting all files that have changed since a given date? I'm unclear how we can do that without being able to supply a wildcard. Is there another recommendation for achieving that?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    The /2/files/list_folder and /2/files/list_folder/continue endpoints do not restrict you to listing files that have changed since a certain date (nor do they offer date filters exactly). They can be used to list the full contents under any path, such as a specific folder or the root folder (identified by the empty string "').

     

    The /2/files/list_folder/continue endpoint can also be used to keep track of further changes over time.

     

    I recommend reading the File Access Guide and Detecting Changes Guide for more information.

  • HippoJens's avatar
    HippoJens
    New member | Level 2
    4 years ago

    Any news on this ?

    Also in the User Frontend ?

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!