Wordpress WooCommerce REST API-使用after/before参数获取订单
我正在使用WooCommerce REST API(),能够成功下载客户、订单等。我现在只想下载两个日期之间的订单列表-我可以在订单文档中看到以下参数:Wordpress WooCommerce REST API-使用after/before参数获取订单,wordpress,woocommerce,woocommerce-rest-api,Wordpress,Woocommerce,Woocommerce Rest Api,我正在使用WooCommerce REST API(),能够成功下载客户、订单等。我现在只想下载两个日期之间的订单列表-我可以在订单文档中看到以下参数: after string Limit response to resources published after a given ISO8601 compliant date. before string Limit response to resources published before a given ISO8601 comp
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标准的有效日期。找不到此请求的外观示例,因此不确定从这里转到何处。结果是您还需要指定时间,例如
after=2016-11-20T13:57:31.2311892-04:00
你能让它在正时区工作吗,比如+01:00?