APIs & Integrations

Anis_Halayem
Member

Get updated contacts in date range

SOLVE

Hello Hubspot Community,

 

We manage to call periodically hubspot api, via a batch, to get the updated or inserted contacts between 2 dates ( in the past ) expressed with timestamp in seconds:

call n°1 at 12:00:31 => GTE 12:00:00, LT: 12:00:30
call n°2 at 12:01:01 => GTE 12:00:30, LT: 12:01:00
...
and so on

 

I would like to know if there is a chance that i miss an updated or inserted contact in my different calls to the web service, for example: a contact was updated at 12:00:29 but not returned in call n°1, if yes, what is the best practices and what can you advise me

0 Upvotes
1 Accepted solution
Mike_Eastwood
Solution
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Get updated contacts in date range

SOLVE

Hi @Philip_JCD 

 

While I haven't tried the API Call you are using – in my experience – all datetime parameters within HubSpot are in UNIX Time in Microseconds.

 

So, my assupltion is that if you give a time in Microseconds it should work predictibly.

 

But – it's an API so nothing ever works 100% predictably 100% of the time (UNIX or otherwise).

 

Have fun

Mike

View solution in original post

4 Replies 4
Mike_Eastwood
Solution
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Get updated contacts in date range

SOLVE

Hi @Philip_JCD 

 

While I haven't tried the API Call you are using – in my experience – all datetime parameters within HubSpot are in UNIX Time in Microseconds.

 

So, my assupltion is that if you give a time in Microseconds it should work predictibly.

 

But – it's an API so nothing ever works 100% predictably 100% of the time (UNIX or otherwise).

 

Have fun

Mike

Philip_JCD
Participant

Get updated contacts in date range

SOLVE

Hello @dennisedson and @Mike_Eastwood , and thank you for your concern

As a teammate of Anis, I would like to add some context.

 

We are using HubSpot Company API and calling the /search endpoint with a filter on hs_lastmodifieddate.

Like this we are able to retrieve the companies updated between a time frame.

 

Let imagine that a user, on the HubSpot UI update a company at 10:00:29:999 .
I guess that the process to handle and store this change will probably take more than 1ms, so this company will be "really updated" at 10:00:30:227.
In this case, which last modified date will be returned? 10:00:29:999 or 10:00:30:227 or something else?

0 Upvotes
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Get updated contacts in date range

SOLVE

Hi @Anis_Halayem 

 

As far as I know you can NOT search using the API for specific date ranges.

 

Could you use a Webhook, triggered by a Contact Update, to call you system?

 

Mike

dennisedson
HubSpot Product Team
HubSpot Product Team

Get updated contacts in date range

SOLVE

Hi @Anis_Halayem ,

I don't know of any reason why that record would be excluded/missed if it is within your search criteria.  Curious to know more about your project.

@Mike_Eastwood , do you have any thoughts?