I want to get orders for the specific date but getting below error tried several date formates but getting the same error. This only happens when I am adding date parameters(before and after). This api works fine for per_page or without any param.
WooCommerce wooCommerce = new WooCommerceAPI(config, ApiVersionType.V3);
Map<String, String> params = new HashMap<>();
params.put("per_page","10");
params.put("after","2016-11-20T13:57:31.2311892-04:00");
params.put("before","2017-11-20T13:57:31.2311892-04:00");
List<Map<String, Object>> orders = wooCommerce.getAll(EndpointBaseType.ORDERS.getValue(), params);
This code is giving me an error
Exception in thread "main" java.lang.RuntimeException: Can’t parse retrieved object: {code=woocommerce_rest_authentication_error, message=Invalid signature – provided signature does not match., data={status=401}}
2
Answers
I got the solution for the date issue here is the solution. we need to encode the dates.
For me just using this format 2021-07-01T11:51:36 helped.