Skip to main content
Question

[.NET] Issue with QueryAsync

  • May 22, 2025
  • 2 replies
  • 42 views

Forum|alt.badge.img

Hi,

 

I'm trying to retrieve the folder_id based on a specific name (which is UID form like '2b1c3292-bf94-4b26-b43d-b4fe6afb5106'), but I can't find why BOX reports me the another FOLDER_ID

 

I've try the following command (where document_id = string above)

  • BoxClientCompany.SearchManager.QueryAsync(query:=document_id, type:="folder")
  • BoxClientCompany.SearchManager.SearchAsync(keyword:=document_id, type:="folder")

Both commands return me another folder name : 'b6837ab4-9ad2-493b-a3c1-023b1fa41172'

 

(I have the same with file document)

 

My workaround for now will be to get all folders, then apply a filter. however, as I'm expecting to have thousand of folders, this is not an optimized process...

 

Any helps are welcome.

 

Frederic

 

 

2 replies

Forum|alt.badge.img

 By default, the Search API uses some fuzzy matching to find results; if you're looking for a more exact match, you can put double-quotes around your search term:

BoxClientCompany.SearchManager.QueryAsync(query:="""" & document_id & """", type:="folder")

 

Does that reduce the number of search results you get? 


Forum|alt.badge.img

Hi,

 

Much better. Box returns now the correct FolderID...

 

Thanks, Fred