Page 1 of 1

Search by date range using API

PostPosted:Tue Aug 11, 2020 7:52 am
by kenwong730
Hi all,
I am trying to use API of community version and face a problem below.

I wanna to search file by date range and it returns an unknown exception. Here is the code:
Code: Select all
DateTime dateFF = new DateTime(2020, 8, 6);
DateTime dateTT = new DateTime(2020, 8, 6);

QueryParams qParams = new QueryParams();
qParams.domain = QueryParams.DOCUMENT;
qParams.lastModifiedFrom = dateFF;
qParams.lastModifiedTo = dateTT;  

foreach (QueryResult qr in ws.find(qParams))
{
       System.Console.WriteLine(qr.node.path);
}
the exception:
Code: Select all
com.openkm.sdk4csharp.exception.OKMRestException: SearchImpl (find)
SearchImpl (find): 6/8/2020 00:00:00

com.openkm.sdk4csharp.exception.UnknowException: SearchImpl (find): 6/8/2020 00:00:00
   at com.openkm.sdk4csharp.impl.SearchImpl.find(QueryParams qp)
   at com.openkm.sdk4csharp.impl.SearchImpl.find(QueryParams qp)
   at com.openkm.sdk4csharp.OKMWebservice20.find(QueryParams qp)
   at OKMRest.Program.Main(String[] args) in C:\Users\kenwong\Desktop\OKM\okmtest2\okmtest2\Program.cs:line 73

Re: Search by date range using API

PostPosted:Fri Aug 14, 2020 1:24 pm
by pherrera
Hi,

There is indeed a problem with the dates, thanks for sharing.
We will work on this for the next version of the SDK.