Object Filter for Inovice create date

2019-09-09 14:12发布

I am using rest API to get invoices whose create date is greater than some date (eg: After 1st September 2015).

GET
https://{{sluser}}:{{slkey}}@api.softlayer.com/rest/v3.1/SoftLayer_Account/getInvoices?objectFilter={"createDate":{"operation":"greaterThanDate","options":[{"name":"date", "value":"10/01/2015"}]}}&resultLimit=1,5

but this seems to be giving first 5 invoices. May I now what is wrong in the objectFilter? Also how can I specify the date format dd-MM-YYYY or mm-dd-yyyy or yyyy-mm-dd?

1条回答
淡お忘
2楼-- · 2019-09-09 14:42

Try the following REST request:

https://[username]:[apikey] @api.softlayer.com/rest/v3/SoftLayer_Account/getInvoices?objectFilter={   "invoices": {     "createDate": {       "operation": "greaterThanDate",       "options": [         {           "name": "date",           "value": [             "01/22/2016"           ]         }       ]     }   } }&objectMask=mask[createDate]
Method: GET

Where: date format is mm-dd-yyyy.

This is other example using “betweenDate”:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getInvoices?objectFilter={   "invoices": {     "createDate": {       "operation": "betweenDate",       "options": [         {           "name": "startDate",           "value": ["02/01/2014"]         },         {           "name": "endDate",           "value": ["02/13/2014"]        }       ]     }   } }&objectMask=mask[createDate]
Method: GET

References:

Object Filters

More SoftLayer REST API Examples

查看更多
登录 后发表回答