Server 400 reponse when updating date property with API call
Stuck.
I have a custom property “QuoteDate” on my deals properties that I made in late December. I have been making the same calls consistently in Java App for other identically defined date picker fields (albeit with different names!) for a few months with no dramas
I know that the definition required is milliseconds since 1970 etc.
However I have run into a couple of snags in the new year - it seems if I now when I submit my JSON to the site using a PUT call to:
I get a server response of 400 for newly created deal properties.
I have been looking into this today and have established if I change the definition of the property to a single line string through the front end then all is well with the API PUT and it dumps in the desired value as text, “1513583567000”, say
After I have run through a debug of the java code in Eclipse; if I change the field definition back to “date picker” then the date picker is correctly populated, “18/12/2017” for the above example [[millis since 1970]]
Has anyone else seen this before?
This is the obfuscated PUT parameters I used for both the successful 200 when the field was a string and the unsuccessful 400 when it was defined as a date
The quotedate property is a date property, not a datetime property, so it will only accept unix timestamps set to UTC midnight for a particular day. This isn’t necessarily the issue, just something I wanted to mention upfront. I’ve included some documentation on the distinction below.
The endpoint to update an existing deal is https://api.hubapi.com/deals/v1/deal/:dealid, and it accepts PUT requests. Calls to /deals/v1/deals have to be POST requests, and will create new deals.
Can you try to make another request to the update deal endpoint with a timestamp set to UTC midnight?
Can you send me a link to the deal property in HubSpot so that I can do some testing? Also, are you updating existing deal records or creating new ones?