Update Custom Date Picker in Deals through the API

deals

#1

My company has created a custom property under the deals section of Delivery Date (delivery_date) which is set to Date Picker. When I try to post to "Update a Deal" https://api.hubapi.com/deals/v1/deal/{dealID}?hapikey={apiKey}, I get a (400) bad request.

I am converting my DateTime to Unix Milliseconds.

My JSON string looks like this :
{
"properties": [
{
"name":"delivery_date",
"value":1542085200000
}
]
}

Does something look wrong with this request? Or am I supposed to do something before I am allowed to update this field?

The program I am writing is a quick C# windows form to upload an excel file and read the values to a model, convert to JSON, and update the selected Deals by DealID. I am testing various fields before I move everything to a single request. So far, I can't figure out why this field won't accept the Unix Milliseconds.

Thank you,

KO


#2

Error was converting time for Date Picker. Has to be put in UTC.


#4

Welcome, @kobrien.

I'm glad you were able to find a solution so quickly!

For others viewing this topic, check out the How should timestamps be formatted for HubSpot's APIs? article for additional information.