Invalid model provided. Error was: Syntax error: offset=17, error=invalid character '-' after object key:value pair

Hi,

I’m trying to update the end_date via curl

Supposing I’m doing:

export DATE="$( date -u '+%Y-%m-%dT%H:%M:%S+00:00' )"
curl ..... -d '{"end_date":'"${DATE}"'}'

It fails

but with the content of $DATE, like 2022-12-09T13:26:30+00:00:

curl ..... -d '{"end_date":"2022-12-09T13:26:30+00:00"}'

it works.

The error is:

{"message":"Invalid model provided. Error was: Syntax error: offset=17, error=invalid character '-' after object key:value pair"}

Anyway, it should be as another bugreport, but after doing the POST with the manual date, I got the bucket_id changed from 17 to 18, so I always need to specify it.

IS possible specify the date as epoch so we solve any parsing problems?

It’s failing because the json string you’re sending does not contain " around the date. So the full string you’re sending is this:

curl ..... -d '{"end_date":2022-12-09T13:26:30+00:00}'

which is not valid json. Therefore I would not consider this a bug.

Only ISO dates are supported.