Skip to main content

Hello - Using the Box List Recents API, I would like to exclude any events where the root-level parent folder is private (has_collaborations=false).



It looks like I can pass has_collaborations as a field, but this only tells me about the item itself - I need to know if the item’s root level parent is also private.



To get the parent, I can use path_collection, but when passing path_collection.entries.has_collaborations as a field to https://api.box.com/2.0/recent_items, nothing is returned.



Is there another way to exclude recent events where the parent event is private?



Thanks,

Hi @dominic-dev, welcome to the forum.



Can you elaborate a bit more?



If I understood correctly you are querying the recent items end point.



This will return a collection of items, and you are looking for the path collection.



Something like:



curl --location 'https://api.box.com/2.0/recent_items?fields=path_collection' \

--header 'Authorization: Bearer 65S9'



With this result example:



{

"next_marker": "b2Zmc2V0PTU=",

"limit": 5,

"order": {

"by": "interacted_at",

"direction": "DESC"

},

"entries": [

{

"type": "recent_item",

"interaction_type": "item_open",

"interacted_at": "2023-08-23T08:59:53-07:00",

"item": {

"type": "file",

"id": "1010742636771",

"etag": "1",

"path_collection": {

"total_count": 1,

"entries": [

{

"type": "folder",

"id": "0",

"sequence_id": null,

"etag": null,

"name": "All Files"

}

]

}

},

"interaction_shared_link": null

}

]

}



I’m unable to see the has_collaborations, and I’m not even sure it is included on the specification of the API.



Can you help me duplicate your use case?



Cheers


Reply