有什么方法可以让 softlaye API 的输出按其中一个属性排序?
Is there any way to get the output of a softlaye API sorted by one of the attribute?
我正在使用 API 列出 typeCode=RECURRING 的发票。
我注意到我得到的输出中最旧的发票(最旧的创建日期)位于顶部。我能否以相反的顺序输出,即最新创建日期在顶部的发票?
谢谢。
试试这个:
GET https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getInvoices?objectFilter={"invoices": {"typeCode": {"operation": "RECURRING"}, "createDate": {"operation": "orderBy", "options": [{"name": "sort", "value": ["ASC"]}, {"name": "lower"}, {"name": "sortOrder", "value":[1]}]}}}
如果您需要倒序输出,请将 "ASC" 更改为 "DESC"
此致
我正在使用 API 列出 typeCode=RECURRING 的发票。
我注意到我得到的输出中最旧的发票(最旧的创建日期)位于顶部。我能否以相反的顺序输出,即最新创建日期在顶部的发票?
谢谢。
试试这个:
GET https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getInvoices?objectFilter={"invoices": {"typeCode": {"operation": "RECURRING"}, "createDate": {"operation": "orderBy", "options": [{"name": "sort", "value": ["ASC"]}, {"name": "lower"}, {"name": "sortOrder", "value":[1]}]}}}
如果您需要倒序输出,请将 "ASC" 更改为 "DESC"
此致