You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Thang2000
2 years agoExplorer | Level 4
Search files in folder based on file tags python sdk
I'm trying to search files in a folder based on file tag, python SDK, yet encountering an error when trying to use my folder path:
from dropbox.files import SearchOptions
# search_op = SearchOptions() # this works but gives me everything from master folder
search_op = SearchOptions(path="/Thang Nguyen/Nano/Photos/Appurtenances/", max_results=10)
dm = dbx.files_search_v2(query="significant", options=search_op)
raise BadInputError(request_id, res.text)
dropbox.exceptions.BadInputError: BadInputError('58ddfa8a32824ea9b8e80882f2ef3a59', 'Error in call to API function "files/search_v2": invalid_argument')
Also, right now I'm passing in "query" and I'm assuming that would retrieve all files associate with "significant" keyword. How do I specify to search by tags only? Any code example would be a great help.
I also need to implement this function in Java.
- Greg-DBDropbox Staff
Thang2000 As Здравко said, the error you're getting is because of the extra "/" you have at the end of your "path" value. Remove that extra slash to get that to work.
The Dropbox Java SDK offers the same search functionality.
As for searching by tags only, unfortunately the Dropbox API (regardless of which SDK you're using, if any) doesn't currently offer an option for restricting the search to match tag values only, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 3 hours agoIf 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!