PUT via API won’t update field raw?

So I’m trying to update a record via API and what I would like to do is update a raw field so calendar entries can be different time lengths than the standard two hours. If I use a GET request, I can see all of the information that the raw Field would use if it had a FROM time and TO time as well as an “allday” parameter.

My problem is that when I try to update any of this information via put request the information seems to get ignored and the field is not updated. I’ve tried to update both the regular field as well as the field raw at the same time but I still don’t get the correct response. For example, I simply want to change the date and time Field to show something like 8 AM to 8:30 AM, but Default 8 AM to 10 AM.

I get a 200 response.
Any ideas?

Hi @Irfan - can you share your code?

sure, the body of the PUT is like this:

{"field_149_raw": {            "date": "04/19/2024",
            "date_formatted": "04/19/2024",
            "hours": "02",
            "minutes": "00",
            "am_pm": "AM",
            "unix_timestamp": 1713492000000,
            "iso_timestamp": "2024-04-19T02:00:00.000Z",
            "timestamp": "04/19/2024 02:00 am",
            "time": 120,
            "to": {
                "date": "04/19/2024",
                "date_formatted": "04/19/2024",
                "hours": "05",
                "minutes": "30",
                "am_pm": "AM",
                "unix_timestamp": 1713504600000,
                "iso_timestamp": "2024-04-19T05:30:00.000Z",
                "timestamp": "04/19/2024 05:30 am",
                "time": 330
            }
        }
}

edit: i realized i had the wrong UNIX timestamp but even after correcting that (shown above) i still just get null in the field.

Even if i copy over the existing data exactly, and just run the request, it nulls the field.

example:

   "field_149_raw": {
            "date": "04/19/2024",
            "date_formatted": "04/19/2024",
            "hours": "07",
            "minutes": "00",
            "am_pm": "AM",
            "unix_timestamp": 1713510000000,
            "iso_timestamp": "2024-04-19T07:00:00.000Z",
            "timestamp": "04/19/2024 07:00 am",
            "time": 420,
            "to": {
                "date": "04/19/2024",
                "date_formatted": "04/19/2024",
                "hours": "08",
                "minutes": "00",
                "am_pm": "AM",
                "unix_timestamp": 1713513600000,
                "iso_timestamp": "2024-04-19T08:00:00.000Z",
                "timestamp": "04/19/2024 08:00 am",
                "time": 480
            }
        }

Solved it… i realized i just need to add the time into the field_xxx, not field_xxx_raw… and give additional fields even though its not in the GET response. Basically add the time to the date, and then add the “to” like we have iin the raw fields, but just add to the regular non-raw field instead and it works:

{"field_149": 
{"date":"04/21/2024 05:00 am",
"to":{"date":"04/21/2024 05:30pm"}}}

if you run the GET again, you would get back:

"field_149": "04/21/2024 5:00am to 5:30pm"
1 Like