Rest API can't input date

I’m using engine-rest to evaluate rule, but when input date data error will apear

{
    "type": "InvalidRequestException",
    "message": "Cannot convert value '1997-12-10T00:00:00' of type 'Date' to java type java.util.Date"
}

My curl and dmn file bellow, thank you

curl --location --request POST 'http://localhost:8080/engine-rest/decision-definition/key/birthOfDate/evaluate' \
--header 'Content-Type: application/json' \
--data-raw '{
    "variables": {
        "dateOfBirth": {
            "value": "1997-12-10T00:00:00",
            "type": "Date"
        }
    }
}'

birth-of-date.dmn (1.4 KB)

Hi @haihn
If I correctly understand the problem then I guess you might need to add TZ and milliseconds to the date. Like “1997-12-10T00:00:00.000+02:00”.
Please check the documentation - Date Format | docs.camunda.org

Hi @Alex_Voloshyn added TZ error still apear

{
    "type": "InvalidRequestException",
    "message": "Cannot convert value '1997-12-10T00:00:00.000+02:00' of type 'Date' to java type java.util.Date"
}

What if you try to change the TZ to +0200(without colons)?

1 Like

Oh it works, thank you very much

You’re welcome. Please mark the reply as the solution so it’s visible that the issue was solved.

1 Like