| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
REST API Module | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
REST API Module
Trying to get all orders from 2020.
I have tried following the documentation and pass a condition with a start date and end date as an array. I have tried both Unix time and W3C time formats and all I can get is it returning all lifetime orders. I have tried with W3Ctime: https://agritronixcorp.com/admin.php?target=RESTAPI&_key=<rest-api-key>&_path=order&_cnd[dateRange]=[2020-01-01T00:00:01-04:00,2020-06-01T11:46:56-04:00] I have tried with Unix Time: https://agritronixcorp.com/admin.php?target=RESTAPI&_key=<rest-api-key>&_path=order&_cnd[dateRange]=[1577836801,1590693834] I will point out that I have replaced my actual API key with a placeholder in the examples above. Does anyone have any advice?
__________________
DEV: X-Cart Business 5.5.0.9 PROD: X-Cart Business 5.3.6.8 www.agritronixcorp.com |
|||||||
#2
|
|||||||
|
|||||||
Re: REST API Module
You should use not the Timestamp format but the format from your Orders section. Simply copy past it into your API request.
__________________
X-Cart Team |
|||||||
#3
|
|||||||
|
|||||||
Re: REST API Module
SOLVED:
For anyone else having this problem. despite the documentation saying it wants an array [start,end] It doesn't. As Memoto said above you should go to your orders page and copy the date from there. To clarify go to the orders page and use the filter option to select the dates you want. then copy the result from the text box. for me it is like this: 01-Jan-2020 ~ 01-Jun-2020 then paste that in your api call https://agritronixcorp.com/admin.php?target=RESTAPI&_key=<rest-api-key>&_path=order&_cnd[dateRange]=01-Jan-2020 ~ 01-Jun-2020 That should do it.
__________________
DEV: X-Cart Business 5.5.0.9 PROD: X-Cart Business 5.3.6.8 www.agritronixcorp.com |
|||||||
|
|||
X-Cart forums © 2001-2020
|