Skip to main content
Question

Search within a folder using tags - API

  • May 22, 2025
  • 4 replies
  • 46 views

Forum|alt.badge.img

Hi,

 

I am trying to retrieve files with specific tags only, but I have not find the solution yet.

 

I have this: 

curl https://api.box.com/2.0/folders/4***phone number removed for privacy***/items?fields=content_type,name,tags,id -H "Authorization: Bearer MY KEY"

 

but it retrieves all items inside the folder, I want to use a filter to limit search by tags.

 

any ideas?

 

Regards,

4 replies

Forum|alt.badge.img

 You should be able to use the Search API to do this — something like the following should do what you want (just replace the ALL_CAPS parts with your parameters):

 

curl -H "Authorization: Bearer ACCESS_TOKEN" https://api.box.com/2.0/search?query=TAG_NAME&content_types=tags&ancestor_folder_ids=FOLDER_ID

Forum|alt.badge.img

 Thank you,

 

Tried the code and it worked until certain point, which it will not recognize "ancestor_folder_ids". 

but thank you again you gave me a way out!

 

BOX_image_not_found.png

 

 

 


Forum|alt.badge.img

This didn't work for us.  Is there some documentation on exactly how these strings are supposed to be formed?   

Ideally we're looking for a regex or sql type search into tag contents (or metadata contents) 


Forum|alt.badge.img

Is there confirmation that it's work again?