Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

REST API Module

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 06-01-2020, 08:21 AM
 
atclarkson atclarkson is offline
 

Newbie
  
Join Date: Mar 2015
Posts: 8
 

Default 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
Reply With Quote
  #2  
Old 06-01-2020, 08:50 AM
 
memoto memoto is offline
 

X-Cart team
  
Join Date: Feb 2018
Posts: 246
 

Default 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
Reply With Quote
  #3  
Old 06-01-2020, 09:03 AM
 
atclarkson atclarkson is offline
 

Newbie
  
Join Date: Mar 2015
Posts: 8
 

Default 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
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:31 AM.

   

 
X-Cart forums © 2001-2020