I’ve pushed some updates to the develop branch and will be in the next release which make the values passed to these fields via the REST API a little more flexible (e.g. it will take timestamps and formatted date values), but for now, you’ll have to format the data the way the field expects it.
In the case of the text_datetime_timestamp
field type, you need to give it an array with date and time values:
curl --request POST \
--url '<REST_URL>/cmb2/v1/boxes/<BOX_ID>/fields/<FIELD_ID>?object_id=<POST_ID>&object_type=post&value%5Bdate%5D=2021-04-09&value%5Btime%5D=13%3A45'
Or you can include the value in the BODY of the request as JSON:
curl --request POST \
--url '<REST_URL>/cmb2/v1/boxes/<BOX_ID>/fields/<FIELD_ID>?object_id=<POST_ID>&object_type=post' \
--header 'Content-Type: application/json' \
--data '{"value":{"date":"2021-04-09","time":"19:45"}}'
I hope that makes sense.