Valid formats for date fields when posting via HubSpot API
Hi.
I’m trying to figure out a (or the) correct format for sending date parameters via a POST request to a form with a date picker via the /uploads/form/v2/:portal_id/:form_guid endpoint.
I first tried yyyy-mm-dd format, e.g., for August 15, 2016 I sent 2016-08-15. Although this seems to be interpreted correctly when you view submissions for that particular form, when looking at the associated Contact that it creates or updates, the date field displays Invalid date in red.
On the other hand, sending the date in mmm dd yyyy, e.g. Aug 15 2016, displays the date as Invalid date when viewing submissions to the form, but when drilling down to a specific Contact, the date displays correctly.
Assuming I’d prefer the latter — that this date get written to the Contact’s record correctly — is mmm dd yyyy the format of choice to send via this endpoint? Is there a standard format for sending date parameters to the HubSpot API that would be correctly interpreted in both cases? Can I decouple the way dates are displayed in HubSpot and how I choose to send them via the API by some admin setting?
Valid formats for date fields when posting via HubSpot API
I am having some trouble submitting post requests to create a deal because the timestamp value for a date picker property is not being accepted by the hubspot api. Here is the timestamp value 1206331200000. The date is 3/24/2008. The API accepts the value of 1430438400000 that you list above but not my value. I have run my value through some online converters and it shows as being valid. Why is the Hubspot API returning bad request when this value is included in the request.
Date properties need to be set as UNIX formatted timestamps, in milliseconds. As an example, you would use 1430438400000 as the value for the time 01 May 2015 00:00:00 UTC. This goes for form submissions as well as updates made through the Contacts API.
HubSpot API endpoints accept UNIX formatted timestamps in milliseconds. Most scripting languages have built-in functions or existing libraries that handle time conversion, but you must ensure that your timestamp values are in the correct UNIX...