APIs & Integrations

vinebhat24
Participant

HubSpot Web API Sync Time Not Functioning for deals

SOLVE

We are trying to run an incremental sync that should only bring data over for last 25 minutes. However, every time the sync starts, it fetches the entire data. How can I ensure that the data sync only focuses on the recent updates and not bring the entire dataset.

As per API guidelines, we have used the below API to get the deals. We have added "since" parameter in our request to get the last modified data based on unix time stamp.

Get Recent Deals | Deals API

GET /deals/v1/deal/recent/modified


"https://api.hubapi.com/deals/v1/deal/recent/modified?hapikey=demo&count=100&since=" + unixTimestamp

We are calculating time stamp as per below code.

Int32 unixTimestamp= ((Int32)(DateTime.UtcNow.AddDays(-1).Subtract(new DateTime(1970, 1, 1))).TotalSeconds).ToString()

snapshot

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

HubSpot Web API Sync Time Not Functioning for deals

SOLVE

Hi @vinebhat24,

It looks like you may be calculating the timestamp in seconds rather than in milliseconds (TotalSeconds). Can you share your Hub ID and a few example timestamps which returned the exact same deals?

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
1 Reply 1
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

HubSpot Web API Sync Time Not Functioning for deals

SOLVE

Hi @vinebhat24,

It looks like you may be calculating the timestamp in seconds rather than in milliseconds (TotalSeconds). Can you share your Hub ID and a few example timestamps which returned the exact same deals?

Isaac Takushi

Associate Certification Manager
0 Upvotes