Search On Doc ID
I have a list of Box Doc IDs that I will pass in and need to get Box to return me back those which are either valid (or for which that authenticated user has permissions to). One way I could do this is to use the Get Info API call and pass these in one at a time. (Gross!)
I am trying to figure out a way to do this all at once with the API and was thinking the Search API might be of use here. Can anyone tell me if, when using the Search API, I can do a filter by Doc IDs? Basically, I will have a metadata template key and a list of Box Doc IDs as mentioned above.
Beyond that I am wondering if there are any other options that I can't think of or don't know about.
-
Hey ,
Thanks for the message! Box Certified Professionals don't often make their way over to the Dev Forums -- welcome! Happy to help!
The Search API is definitely the way to go, especially if you have metadata! What you'd do is make the Search API call with the mdfilters parameters to filter by metadata, and then filter your results by those Doc IDs. You may need to paginate that search result, and depending on how many Doc IDs you have and how many items have that metadata applied to them, it may be easier to do it the gross way. If you script it up, hopefully, it wouldn't be too bad!
What you couldn't do is search for doc IDs, unfortunately.
Thanks,
Jason
-
I tend to slide and work between the two worlds. 🙂
Ok, quick follow up question then. Using mdfilters can I submit multiple values for a single field? So if I have a field like customer ID and have multiple values I want to filter on will mdfilters allow me to submit an array or range of filters instead of filtering on one customer ID at a time?
Please sign in to leave a comment.
Comments
2 comments