cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right 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: 

search with file tags api

search with file tags api

adityadsq
Explorer | Level 3

i am trying to get the list of files based on tags using search api. when i search file name it return the data but not with the tags. please help

12 Replies 12

Greg-DB
Dropbox Staff

I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:

  • the name and version number of the platform and SDK/library you are using, if any
  • the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)
  • the full text of any error or unexpected output

adityadsq
Explorer | Level 3

Hi Greg,

Thanks for your response.

 

Let me explain the requirement in-detailed:We have a set of videos and images added in Dropbox in various folders. Every file is associated with some tagnames. Further, I’ve developed a web page where it has a search box and entering a keyword, it should pickup all the files from dropbox. I am using 2/files/search_v2 API. It is working fine when I search with the file name/title. But it is not considering the tagnames. How can I implement this? Apart from the filename/title, it should return the relevant videos/pictures when searched with tag names as well. Hope this clarifies. Thanks in advance!

Greg-DB
Dropbox Staff

Thanks for the additional information. Just to clarify a bit further, are you referring to tags applied to items using the Dropbox web site or /2/files/tags/add, or something else?

adityadsq
Explorer | Level 3

Hi,

 

I want to search and retrieve files with tag names. search_tags key is returning key not found error. 

when i search in dropbox with tag names it was showing the files that matches to the tag names. 

but in the same condition is not working in the api (https://api.dropboxapi.com/2/files/search_v2). i have given all the parameters required. 

Parameters: 

{
    "query": "test",
    "options": {
        "path": "pathname",
        "max_results": 10,
        "image_content_search": false,
        "order_by": {
            ".tag": "relevance"
        },
        "reverse_order": false
    },
    "match_field_options": {
        "include_highlights": false
    }
}

Greg-DB
Dropbox Staff

Just to confirm exactly what functionality you are referring to, are you applying the tags you mentioned by using the Dropbox web site or /2/files/tags/add, or something else?

 

Also, note that you should only be using the options and fields documented for /2/files/search_v2 here, which does not include "search_tags", "image_content_search", or "reverse_order".

amilcarvalho
Explorer | Level 3

Hello,

I'm getting the same issue. I have a file with tags added by website and by the api endpoint 2/files/tags/add. 
When I make the request only works with file name.

Hope you can help me

Здравко
Legendary | Level 20

Hi @amilcarvalho,

I checked it and everything works. Yes, it's inconvenient since not option to direct the search to tags only and many unrelated result entries may appear. In spite all tags get in the result in correct way.

What's the exact call your performed? Did you restrict the search operation in a way that can exclude some tagged entry (or all of them)? For instance, limiting search to filenames will exclude any tags. Inappropriate extensions and/or categories would reflect to ability of find all (or some) tags!

Let's hope this feature will be improved by Dropbox.

Till then, I hope this gives workaround direction.

amilcarvalho
Explorer | Level 3

Hello,

 

Thanks for you answer. I  post to the endpoint "/2/files/search_v2". With just {"query":"tag1"} on body.
I want to retrieve content that contains the tag1. Is this possible?


curl -X POST https://api.dropboxapi.com/2/files/search_v2 \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{"query":"tag1"}'

 

amilcarvalho
Explorer | Level 3

Hello,

 

Thanks for you answer. I  post to the endpoint "/2/files/search_v2". With just {"query":"tag1"} on body.
I want to retrieve content that contains the tag1. Is this possible?


curl -X POST https://api.dropboxapi.com/2/files/search_v2 \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{"query":"tag1"}'

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    amilcarvalho Explorer | Level 3
What do Dropbox user levels mean?