London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Content Delivery API - Filter by date

Vote:
 

Hi,

I've installed the latest version of Episerver Content Delivery API 2.6.1. I need to call the api to get all events after a specific date and it seems that I can't filter the events by date.

I've tried the example provided by Episerver here: https://world.episerver.com/documentation/developer-guides/content-delivery-api/content-search-api/#Filtering

but when I test it in my solution

Get /api/episerver/v2.0/search/content/?filter=startPublish ge 2019-09-11T09:47:19Z

and getting this error message:

{
    "error": {
        "code": "InvalidFilterClause",
        "message": "Unable to parse provided filter clause"
    }
}

Is anyone able to filter the content by date?

#207799
Oct 03, 2019 15:20
Vote:
 

Have you tried passing the range of date as per the example?

?filter=startPublish ge 2016-01-01T00:00:00Z and startPublish le 2017-01-01T00:00:00Z

It seems like it is expecting the range of the date to be filtered.

#207815
Oct 04, 2019 10:05
- Oct 04, 2019 10:50
Yes, I've tried. I got the same error message.
Praful Jangid - Oct 05, 2019 6:14
Can you share that request link as well?
- Oct 07, 2019 17:35
That's the url: http://localhost:58022/api/episerver/v2.0/search/content/?filter=startPublish ge 2016-01-01T00:00:00Z and startPublish le 2017-01-01T00:00:00Z
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.