APIs & Integrations

edwinbbu
Participante

datetime not working in the submit form api

resolver

I have referred the developer documentation regarding sending timestamp for hubspot submit form api. I even tried the default 1427997766000 shown in the documentation and it is not working. 

 

0 Avaliação positiva
1 Solução aceita
cbarley
Solução
Alunos da HubSpot
Alunos da HubSpot

datetime not working in the submit form api

resolver

Thanks for that info @edwinbbu , since your field is just a date field, the field must be set to UTC midnight, or the endpoint will not know what to do with that value, and HubSpot will not store the value in the CRM. Further, the V2 Forms API does not do any sort of validation, so you won't get an error if the data isn't sent to HubSpot, we'll just accept anything in that instance. For that reason, the V3 endpoint might be a better option. That said, if you're not seeing an error, would you be able to send the following info:

  1. The full endpoint you're submitting data to.
  2. The raw request request payload you're sending to HubSpot.

I was able to create this simple app that submits to the V2 Forms API a while ago where I've added in a date picker field. This properly submits to HubSpot as a UTC midnight value in milliseconds. Feel free to use it as a guide: https://repl.it/@cbarley10/Forms-V2-endpoint-in-Node-with-a-front-end

 

Here's an example of a contact I just created via that form with the value: http://prntscr.com/o4gx5j

 

Exibir solução no post original

5 Respostas 5
cbarley
Alunos da HubSpot
Alunos da HubSpot

datetime not working in the submit form api

resolver

Hi @edwinbbu , happy to help! I'll need a bit more info first:

  1. is your field a date field, or a datetime field? If you have a link to that property in your account, that would be great to have. Date fields must be set to UTC midnight which is why I ask.
  2. Any errors you are seeing when submitting the form via API would be awesome to see as well.
  3. Are you using the v2 or v3 (with Ajax Support) endpoint? 
  4. Can you please link a page where your form lives and is being submitted via the API?

Thank you!

0 Avaliação positiva
edwinbbu
Participante

datetime not working in the submit form api

resolver

Hi @cbarley , 

1. The field type is date picker. ( it is shown in contact property) .

     Here is the link to the contact property

2. I am not seeing any error when submitting the form via api. I am submitting the datetime field(unix format) along with other fields. All other fields are getting updated.

3. I am not sending via ajax endpoint.

4. I am testing the forms via localhost so I am unable to share the link to page which is getting submitted to forms api.

 

0 Avaliação positiva
cbarley
Solução
Alunos da HubSpot
Alunos da HubSpot

datetime not working in the submit form api

resolver

Thanks for that info @edwinbbu , since your field is just a date field, the field must be set to UTC midnight, or the endpoint will not know what to do with that value, and HubSpot will not store the value in the CRM. Further, the V2 Forms API does not do any sort of validation, so you won't get an error if the data isn't sent to HubSpot, we'll just accept anything in that instance. For that reason, the V3 endpoint might be a better option. That said, if you're not seeing an error, would you be able to send the following info:

  1. The full endpoint you're submitting data to.
  2. The raw request request payload you're sending to HubSpot.

I was able to create this simple app that submits to the V2 Forms API a while ago where I've added in a date picker field. This properly submits to HubSpot as a UTC midnight value in milliseconds. Feel free to use it as a guide: https://repl.it/@cbarley10/Forms-V2-endpoint-in-Node-with-a-front-end

 

Here's an example of a contact I just created via that form with the value: http://prntscr.com/o4gx5j

 

edwinbbu
Participante

datetime not working in the submit form api

resolver

Thanks a lot @cbarley  Finally the date type worked after converting to utc midnight format.

cbarley
Alunos da HubSpot
Alunos da HubSpot

datetime not working in the submit form api

resolver

Great to hear @edwinbbu !

0 Avaliação positiva