One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
scott_halgrim
5 years agoNew member | Level 2
/files/search deprecation and how it relates to the JavaScript SDK
Hey there,
With regard to the deprecation of the /files/search endpoint, I'm curious how it relates to the JavaScript SDK. We're using an older verison of that SDK for our integration, and I'm wondering if we can just upgrade our version and have it use the /files/search_v2 endpoint.
I know we're hitting /files/search from looking at our logs, but I can also tell we're not calling the `filesSearch` route (https://github.com/dropbox/dropbox-sdk-js/blob/8802f727e48352cf7d2bbacef91e53931eacafbb/lib/routes.js#L1027) directly, so it must be called from somewhere else in the code. So as long as we don't call `filesSearch` directly, can we be sure we'll avoid the files/search endpoint?
- Greg-DB
Dropbox Staff
The /2/files/search endpoint is deprecated and is being retired in favor of the /2/files/search_v2 endpoint (and /2/files/search/continue_v2 for the pagination of results following /2/files/search_v2). Each of these endpoints correspond to one method in each official SDK. In the JavaScript SDK, that's:
- /2/files/search => filesSearch
- /2/files/search_v2 => filesSearchV2
- /2/files/search/continue_v2 => filesSearchContinueV2
Only filesSearch in the SDK calls the deprecated /2/files/search. In order to migrate from the deprecated endpoint to the new ones, you should replace any usage of filesSearch in your app with filesSearchV2 and filesSearchContinueV2.
- shalgrimExplorer | Level 4
Thanks so much for your help, Greg. I have some follow-ups.
We are currently on an old verison of the SDK. 2.5.12 to be exact, so we have some catching up to do.
My concern is still about the files/search endpoint that is about to be deprecated. We are seeing calls to that endpoint that are coming from places other than the filesSearch method. I don't know where they're coming from, but I can rule out they're coming from there. I have a hunch that it might be from filesListFolder or filesListFolderContinue.
So, is it the case that other functions in the SDK call filesSearch? What version of the SDK do I need to get to so that I can be sure that by eliminating all of our calls to filesSearch that files/search will never be hit?
(Context: If I jump all the way to 9.0.0 all of our tests fail. I've managed to so far get up to 5.1.0 and still have a working test suite, but even going from there to 6.x causes everything to fail.)
- Greg-DB
Dropbox Staff
Can you elaborate on what you mean when you say you "are seeing calls to that endpoint that are coming from places other than the filesSearch method"? Can you share what you're seeing specifically in that regard? None of the other methods in the SDK should be calling that endpoint.
For instance, filesListFolder just calls /2/files/list_folder, and filesListFolderContinue just calls /2/files/list_folder/continue.
Also, for reference, you can find information about the changes between the versions in the release history and upgrading.md.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 2 days ago
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 or Facebook.
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!