我正在使用 WooCommerce REST API ( http://woocommerce.github.io/woocommerce-rest-api-docs/#introduction ) 并且能够成功下载客户、订单等。我现在只想下载两个日期之间的订单列表 - 我可以在订单文档中看到以下参数:
after string Limit response to resources published after a given ISO8601 compliant date.
before string Limit response to resources published before a given ISO8601 compliant date.
我已将请求的 URL 修改为:
https://mywebsite.com/wp-json/wc/v1/orders?after=2016-08-05&before=2016-08-06&page=1
但我收到此响应的 400 错误:
{
"code": "rest_invalid_param",
"data": {
"params": {
"after": "The date you provided is invalid.",
"before": "The date you provided is invalid."
},
"status": 400
},
"message": "Invalid parameter(s): after, before"
}
据我所知,这两个日期是符合 ISO8601 的有效日期。找不到此请求应如何显示的示例,因此不确定从这里去哪里。