Get Folder’s Items API total_items not accurate
AnsweredI am calling https://api.box.com/2.0/folders/0/items
and the response I get back tells me there should be 51 items, but there are only 49 items in the array that gets returned. Are there some hidden files/folders that are not returned by the API?
{
"total_count": 51,
"entries": ARRAY OF 49 ITEMS HERE
"offset": 0,
"limit": 100,
"order": [
{
"by": "type",
"direction": "ASC"
},
{
"by": "name",
"direction": "ASC"
}
]
}
-
Because of the way we query our database for collaborations, the total_count for the root folder may appear to be higher than it actually is. The "missing" items aren't hidden, they just don't appear in the root folder.
The set of items in the entries list is the authoratative set of top-level items in your account. The total_count can be used as a rough measure of how large your root folder is, but in general might be higher than it should be.
-
Could you elaborate on this? What, exactly, could the two additional items be, in the example provided? If I want to get an accurate count of the actual items, I need to do a len(entries) instead of relying on total_count? Could that be added to the API documentation as I've already coded a customer application to use total_count?
Please sign in to leave a comment.
Comments
2 comments