Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Dan L.10's avatar
Dan L.10
New member | Level 1
10 years ago

HTTP API v2 files/search: not recursive until select top-level folder?

I'm using v2 of the API and running into an unexpected situation with the files/search HTTP endpoint.  Wondering if this is a configuration issue or expected behavior.

I'm trying to list of a user's files of a certain type.  With v1 of the api, you could set path: '' and query: '.xls'.

When I use v2 of the API and hit the files/search endpoint, it seems that the same parameters return nothing.  Only when I set the path to be one of the top-level folders (eg returned from files/list_folder) does it seem to return results (and then it does return results recursively, ie any .xls file in any subfolder).

Is there something special about these top-level folders that prevents an overall search from finding all results?  Is there any way to get around that so I can do a search like "Show me all .xls files in a user's dropbox"?

4 Replies

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

    Hi Dan, I'm not seeing the same behavior when trying this out myself. Can you share your code and output? (Just be sure the redact the access token.) Thanks in advance! 

    If you'd prefer to share privately, you can open an API ticket here:

    https://www.dropbox.com/developers/contact

  • Dan L.10's avatar
    Dan L.10
    New member | Level 1
    10 years ago

    Just using the straight HTTP files/search endpoint.  I get results like {matches: [], more: false, start: 0} with a path of '', and I get matches when I search in one of the folders.

    One possible complication: I use a dropbox business account, and the top-level folders have a different icon (red) than the sub-folders that do work recursively (green):

    ></p>
<p>Not familiar enough with admin side to know what that different icon indicates (a group folder?), but it seems like the search doesn't go down into those. If I start the search inside those it works fine.</p>
<p>The /files/list_folder endpoint doesn't seem to have any special identification for those -- they come back as {'.tag': 'folder', name: ...} just like any other folder, so if it is behavior specific to those types of folders, is there any way of identifying them?</p>
<p>Does that help?  If not, I'll open up a private API ticket.</p>

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

    Thanks! That's helpful, and I can reproduce this now. This seems to only occur for shared folders (which is what that icon signifies). We're looking into it.

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!