Skip to main content

Box List Recent Events API - `path_collection.entries.has_collaborations`

  • September 13, 2023
  • 1 reply
  • 195 views

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,

1 reply

rbarbosa Box
  • Developer Advocate
  • 553 replies
  • September 28, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings