Issue with unix timestamp

Hi,

I’m trying to create contacts through Hubspot’s API. This is the python dictionary with the properties I would like to send to create the contact:

{'properties': {'email': 'juan@venturematic.com', 'firstname': 'Juan', 'lastname': 'Esteban', 'date_joined_social_pulse_community': '1667948400000', 'prnom_et_nom': 'Juan Esteban'}}

date_joined_social_pulse_community is a date picker so the value I send is in UNIX timestamp. If I removed this property from the request it works. Therefore I received this error:

400 Client Error: Bad Request for url: https://api.hubapi.com/crm/v3/objects/contacts

Any idea why this doesn’t work?

Thanks in advance for your help!

Hi, @AEugene :waving_hand: Thanks for reaching out! Furthermore, thank you for including those details.

Questions:

Are you sending your UNIX timestamp as an EPOCH millisecond timestamp?

Are using a date property (including date-picker) and not adatetime property?

If you are needing to add both date and time you’ll need to update your property to bedatetime or create a new customdatetime property via the Properties API endpoints.

Additional information:

  • date properties (including date picker properties created in HubSpot) store the date—not the time.
  • datetime properties store both the date and time.
  • Please note: if you’re using a UNIX timestamp for a date property and try to set a value that isn’t midnight UTC, you’ll receive an error.
  • Full details here — Date and datetime properties in the HubSpot CRM

Have fun building! — Jaycee