Frappe HTTP Api filtering

I am using the HTTP api for bringing data from erpnext, and I need to display the events in a particular date. I have tried using the filters parameter, it normally works with fields like subject and event_type, but doesn't work when I compare with Starts_on or Ends_on fields. 

Here is my scenario :

When I send this request : http://localhost:8080/api/resource/Event/?fields=[%22Subject%22,%22Event_type%22,%22Starts_on%22,%22Ends_on%22,%22all_day%22] (i.e, bringing all the events with some specific fields without filtering) here is my response : 

{
  "data": [
    {
      "Ends_on": null,
      "all_day": 1,
      "Starts_on": "2014-07-17 12:00:00",
      "Event_type": "Private",
      "Subject": "fgsdfgvdgfdgfdgf"
    },
    {
      "Ends_on": "2014-07-31 12:00:00",
      "all_day": null,
      "Starts_on": "2014-07-11 06:00:00",
      "Event_type": "Public",
      "Subject": "RGFVDGFDGFD"
    },
    {
      "Ends_on": "2014-07-24 12:00:00",
      "all_day": null,
      "Starts_on": "2014-07-09 12:00:00",
      "Event_type": "Public",
      "Subject": "itiash pitiAHS"
    },
    {
      "Ends_on": "1995-02-01 00:15:00",
      "all_day": 1,
      "Starts_on": "1995-02-01 00:00:00",
      "Event_type": "Public",
      "Subject": "Birthday: lalalalala"
    }
  ]
}


Now when I try to bring the event which starts on 2014-07-17 12:00:00  (i.e, the first one in the response above).
Here's my request : 
http://localhost:8080/api/resource/Event/?fields=[%22Subject%22,%22Event_type%22,%22Starts_on%22,%22Ends_on%22,%22all_day%22]&filters=[[%22Event%22,%22Starts_on%22,%22=%22,%222014-07-17%2012:00:00%22]] 

But there's no response : {"data":[]}

However, when I try the same kind of filter request, but filter by subject instead of starts_on , it works perfectly fine, like this : 
Request : http://localhost:8080/api/resource/Event/?fields=[%22Subject%22,%22Event_type%22,%22Starts_on%22,%22Ends_on%22,%22all_day%22]&filters=[[%22Event%22,%22Subject%22,%22=%22,%22fgsdfgvdgfdgfdgf%22]]

Response : 
{"data":[{"Ends_on":null,"all_day":1,"Starts_on":"2014-07-17 12:00:00","Event_type":"Private","Subject":"fgsdfgvdgfdgfdgf"}]}

Any idea why this comparing the date is failing? and how i can solve it ? 
P.S : I have tried all of the requests with my Google Chrome browsers.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/a1ed58b8-0cb5-4136-a7b8-4c04404525d8%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Are you sure your dates are correct?



On 13-Jul-2014, at 10:15 am, Shishir Chakraborty <sh...@gmail.com> wrote:

I am using the HTTP api for bringing data from erpnext, and I need to display the events in a particular date. I have tried using the filters parameter, it normally works with fields like subject and event_type, but doesn't work when I compare with Starts_on or Ends_on fields. 

Here is my scenario :

When I send this request : http://localhost:8080/api/resource/Event/?fields=[%22Subject%22,%22Event_type%22,%22Starts_on%22,%22Ends_on%22,%22all_day%22] (i.e, bringing all the events with some specific fields without filtering) here is my response : 

{
  "data": [
    {
      "Ends_on": null,
      "all_day": 1,
      "Starts_on": "2014-07-17 12:00:00",
      "Event_type": "Private",
      "Subject": "fgsdfgvdgfdgfdgf"
    },
    {
      "Ends_on": "2014-07-31 12:00:00",
      "all_day": null,
      "Starts_on": "2014-07-11 06:00:00",
      "Event_type": "Public",
      "Subject": "RGFVDGFDGFD"
    },
    {
      "Ends_on": "2014-07-24 12:00:00",
      "all_day": null,
      "Starts_on": "2014-07-09 12:00:00",
      "Event_type": "Public",
      "Subject": "itiash pitiAHS"
    },
    {
      "Ends_on": "1995-02-01 00:15:00",
      "all_day": 1,
      "Starts_on": "1995-02-01 00:00:00",
      "Event_type": "Public",
      "Subject": "Birthday: lalalalala"
    }
  ]
}


Now when I try to bring the event which starts on 2014-07-17 12:00:00  (i.e, the first one in the response above).
Here's my request : 
http://localhost:8080/api/resource/Event/?fields=[%22Subject%22,%22Event_type%22,%22Starts_on%22,%22Ends_on%22,%22all_day%22]&filters=[[%22Event%22,%22Starts_on%22,%22=%22,%222014-07-17%2012:00:00%22]] 

But there's no response : {"data":[]}

However, when I try the same kind of filter request, but filter by subject instead of starts_on , it works perfectly fine, like this : 
Request : http://localhost:8080/api/resource/Event/?fields=[%22Subject%22,%22Event_type%22,%22Starts_on%22,%22Ends_on%22,%22all_day%22]&filters=[[%22Event%22,%22Subject%22,%22=%22,%22fgsdfgvdgfdgfdgf%22]]

Response : 
{"data":[{"Ends_on":null,"all_day":1,"Starts_on":"2014-07-17 12:00:00","Event_type":"Private","Subject":"fgsdfgvdgfdgfdgf"}]}

Any idea why this comparing the date is failing? and how i can solve it ? 
P.S : I have tried all of the requests with my Google Chrome browsers.




Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/a1ed58b8-0cb5-4136-a7b8-4c04404525d8%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/6A444B63-A423-4F0A-90FB-8C54B01B5633%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.