Get Folder’s Items API returns nothing even though there are items
回答済みhttps://api.box.com/2.0/folders/0/items?limit=1&offset=28 returns nothing:
{"total_count": 51,
"entries": [],
"offset": 28,
"limit": 1,
"order": [
{"by": "type",
"direction": "ASC"},
{"by": "name",
"direction": "ASC"}]}
however, if I set offset to 29,
https://api.box.com/2.0/folders/0/items?limit=1&offset=29, then I get back
{
"total_count": 51,
"entries": [{"type": "folder",
"id": "removed for privacy6",
"sequence_id": "0",
"etag": "0",
"name": "Lucky2016"}],
"offset": 29,
"limit": 1,
"order": [{
"by": "type",
"direction": "ASC"},
{"by": "name",
"direction": "ASC"}]}
This makes no sense. What is happening at offset 28?
-
This is related to the other question you just asked: https://community.box.com/t5/Developer-Forum/Get-Folder-s-Items-API-total-items-not-accurate/m-p/22705#U22705
It is weird, but it is a consequence of the way that the database calls are made to construct the view of the root folder.
Please refer to https://docs.box.com/reference#section-pagination . The guidelines for pagination state that you should continue paging until your offset is greater than the total_count, even if you see a page that has 0 results.
サインインしてコメントを残してください。
コメント
1件のコメント