Error sending Date Picker value through API

JakeW
Contributor

We are sending a date value to a date picker property in the form of YYYY-MM-DD (which we've confirmed with the app is ISO8601 compliant, but maybe that's intrinsic of the date when written that way - don't know what I'm talking about)

 

we are getting this error:

 

"validationResults": [
{
"isValid": false,
"message": "2020-12-01 was not a valid long. Portal xxxxxxx, object type 0-3",
"error": "INVALID_LONG",
"name": "invoice_sent"
}
],
"status": "error",
"message": "Property values were not valid",

 

The Hubspot documentation says this:

Examples:

  • 2015-05-01 would be used for May 1 2015

Not really a developer - any tips you can help me with?

0 Upvotes
4 Replies 4
dennisedson
Community Manager

Hey @JakeW 

You will want the date in the unix timestamp format as detailed here 😀

You are working your way up the ladder as a developer 😉

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes
JakeW
Contributor

Thanks @dennisedson  - am I misreading the FAQ in this case then? One example given is in Unix as you've suggested, but it also lists a stock YYYY-MM-DD as an 'example' of how to send dates to a Date Picker property.

Here's a screenshot from this article I'm referring to

JakeW_0-1606862663943.png

 

I'm only going the extra mile to ask here because our app doesn't have an automatic means to reformat dates into a Unix timestamp

 

0 Upvotes
dennisedson
Community Manager

Hey @JakeW ,

Thanks for following up on that.  Looks like we may have some contradictory messaging 🤔

Would you do me a favor and send me the endpoint that you are posting to (minus hapikey) as well as the json body?

Here is a post with a similar issue as well as the referenced docs

Once you send me the details I asked for, I will test and make sure we get some consistency 😀

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes
JakeW
Contributor

Thanks @dennisedson  - the docs mention UNIX timestamp - I think we can do that through the app we're trying to do this with. I don't know how to determine what endpoint we are posting to, or what a hapikey and json body are, so I'm not sure I can help further o_o

For now I'll just assume that we need to send it in UNIX in milliseconds, and it's incorrect to say that date pickers can receive a straight up YYYY-MM-DD value ...