获取文件夹项目API调用的订购 [英] Ordering of get folder items API call

查看:86
本文介绍了获取文件夹项目API调用的订购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用get folder items API调用,从测试中可以看出顺序似乎是首先出现的文件夹,然后是字母顺序。

I am using the get folder items API call, and I can tell from my tests that the order appears to be folders first and then alphabetical.

此调用是保证总是按此顺序返回项目?

Is this call guaranteed to always return items in that order?

推荐答案

Box Platform团队成员在这里...我们不考虑我们的任何馆藏终结点所返回的结果均是其公共合同的一部分,并且可能会发生变化。至少对于获取/ folders / id / items , JSON响应包括一个 order 数组,该数组显示响应的顺序。

Box Platform team member here ... we do not consider the order of the results returned by any of our collections endpoints part of their public contract and they are subject to change. For GET /folders/id/items at least, the JSON response includes an order array, which shows how the response is ordered.

{
    "total_count": 6,
    "entries": [
        {
            "type": "folder",
            "id": "192429928",
            "sequence_id": "1",
            "etag": "1",
            "name": "Lebron and Friends"
        },
        {
            "type": "folder",
            "id": "192429929",
            "sequence_id": "1",
            "etag": "1",
            "name": "Stephen Curry Three Pointers"
        },
        {
            "type": "file",
            "id": "818853864",
            "sequence_id": "0",
            "etag": "0",
            "name": "Heat.jpg"
        },
        {
            "type": "file",
            "id": "818853862",
            "sequence_id": "0",
            "etag": "0",
            "name": "Warriors.jpg"
        }
    ],
    "offset": 0,
    "limit": 4,
    "order": [
        {
            "by": "type",
            "direction": "ASC"
        },
        {
            "by": "name",
            "direction": "ASC"
        }
    ]
}

请注意,此响应还可以包含Web链接

Note that this response can also include web links.

如果您的应用以某种方式依赖于要订购的物品清单,我们建议在客户端上进行排序。

If your app depends on the list of items being ordered a certain way, we recommend sorting on the client.

这篇关于获取文件夹项目API调用的订购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆