How to use web modeler api to filter on "created" date?

Hello ,
i’m trying to list all milestones created after a certain date.
so using postman i’m calling the endpoint “{{baseUrl}}/api/v1/milestones/search” with the following body:

{
  "filter": {
    "created": ">2024-01-01T11:31:20.206801604Z"
  },
  "page": 0,
  "size": 50
}

i get the following result:

{
    "type": "about:blank",
    "title": "Bad Request",
    "status": 400,
    "instance": "/api/v1/milestones/search"
}

Please how can use this api to get the list of milestones created after a certain date ?

Thanks

Hi @mazenoddo - the created filter is looking for an exact match, not an expression. I don’t think you can filter data based on a range in the Web Modeler API, but I agree that it would be useful! I’ll provide this feedback to the engineers.

hello ,

I was trying to apply this: Integrate Web Modeler into CI/CD | Camunda 8 Docs
and I can see in the page that we can use the ‘>’ for the created filter.

is it a documentation issue ?

thanks

Hi @mazenoddo - interesting, could be that I was mistaken also! I’ll do some testing and find out! Are you using SaaS or a Self Managed instance? If you’re using Self Managed, what version of Web Modeler are you using?

Hi @nathan.loding , self managed version 8.3.1

Hi,

Your query works fine for me agains Saas. You can use the following to filter on a range in Web Modeler API (this can be found in the Web Modeler swagger on SaaS):

You can use suffixes to match date ranges:

||/y	Within the year of the provided date
||/M	Within the month of the provided date
||/w	Within the week of the provided date
||/d	Within the day of the provided date
||/h	Within the hour of the provided date
||/m	Within the minute of the provided date
||/s	Within the second of the provided date

For example:

{
  "filter": {
    "name" : "RELEASE2024-1",
    "created": ">=2024-01-01T00:00:00.000000000Z||/y"
  },
  "sort": [
    {
      "field": "name",
      "direction": "ASC"
    }
  ],
  "page": 0,
  "size": 50
}

Regards,

Maarten

Hello @MaartenvV , I just tried the same request body, it didn’t work on self managed.
Thanks

Hi @mazenoddo, I believe the filter is only available since version 8.4.
There seems to be an issue with the docs, showing this info for 8.3 as well. Sorry for the inconvenience!

Best,
Christian