cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Different namespace behavior /files/list_folder and /files/search_v2 API calls, bug?

Different namespace behavior /files/list_folder and /files/search_v2 API calls, bug?

De L.1
Collaborator | Level 9
Go to solution

Hi there!

 

I am encountering a peculiar issue with the /2/files/search_v2 call in combination with team namespace ids, and I am not sure if this is a bug or the expected behaviour of the API.

 

Consider the following team space configuration:

 

 

/Team Dropbox (1)
/Team Dropbox/Sarah (2)
/Team Dropbox/Sarah/Documents
/Team Dropbox/Sarah/Documents/Example.doc
/Team Dropbox/John (3)

 


When I make a /2/files/list_folder call using {"path":"/Documents"} with the Sarah account, I get the contents of the /Documents folder, including the file Example.doc. This is all perfectly fine.


However, if I also make a call to /2/files/search_v2 using {"query":"Example","options":{"filename_only":true,"path":"/Documents"}} with the Sarah account, I get no results.

 

After some testing I noticed that the /2/files/list_folder call implicitly uses the home folder of Sarah (home_namespace_id: 2) to list the content. However, the /2/files/search_v2 API call uses the root folder (root_namespace_id: 1)So the search call won't return any results in this case because the /Documents path provided isn't correct.

 

To resolve this, I can use {"query":"Example","options":{"filename_only":true,"path":"/Sarah/Documents"}} where I add the Sarah home folder in the path. Or I can add the header Dropbox-API-Path-Root: {".tag":"namespace_id","namespace_id":"2"} to the original call. When I do this, the file Example.doc is returned in the search results.

 

Why are the /files/list_folder and /files/search_v2 calls using a different root/home location? Or is it a bug and should the home_namespace_id (2) also be used implicitly for the /files/search_v2 call, as with the /files/list_folder call? Or am I missing something here? 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

Thanks for reporting this issue. This issue is now fixed and should be working properly.

 

Apologies for any inconvenience this may have caused, and thanks again for bringing this to our attention.

View solution in original post

4 Replies 4

Greg-DB
Dropbox Staff
Go to solution

Thanks for the detailed report! This looks like a bug on the search endpoint. We'll look into it and I'll follow up here when I have an update.

De L.1
Collaborator | Level 9
Go to solution

Thanks for looking into this, Greg! 

 

Is this perhaps related to the issue discussed on https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Search-shared-folder-suddenly-doesn-t-w...? I started getting reports of this issue a few days ago, so it may be a bug that has been introduced recently.

Greg-DB
Dropbox Staff
Go to solution

Yes, that is likely the same issue.

Greg-DB
Dropbox Staff
Go to solution

Thanks for reporting this issue. This issue is now fixed and should be working properly.

 

Apologies for any inconvenience this may have caused, and thanks again for bringing this to our attention.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    De L.1 Collaborator | Level 9
What do Dropbox user levels mean?