想知道是否有一个softlayer rest api,我可以用它来获取过去特定月份的发票。
例如,我想提取2016年4月的发票。我看了Softlayer Billing Invoice服务但是徒劳无功。
此外,我确实在发票对象上看到了一个名为createDate的属性,但不确定它是否对给定方案有任何帮助。
答案 0 :(得分:0)
可以使用Object Filters,在这种情况下,在日期之间使用过滤器是必要的,请尝试以下示例:
https://$username:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Account/getInvoices?objectFilter={"invoices":{"createDate":{"operation":"betweenDate","options":[{"name":"startDate","value":["04/01/2016 00:00:00"]},{"name":"endDate","value":["04/30/2016 23:59:59"]}]}}}
Method: Get
它将显示 04/01/2016 00:00:00 和 04/30/2016 23:59:59
之间的发票<强>参考文献:强>
<强>更新强>
您需要使用&#34; typeCode&#34;:&#34; RECURRING&#34; 从发票中获取信息,在这种情况下,您可以使用以下请求:
https://$username:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Account/getInvoices?objectFilter={"invoices":{"createDate":{"operation":"betweenDate","options":[{"name":"startDate","value":["06/01/2016 00:00:00"]},{"name":"endDate","value":["06/30/2016 23:59:59"]}]}, "typeCode":{"operation":"RECURRING"}}}
Method: Get