0

I want to fetch one day older updated record from HubSpot Contacts, and I have used bellow link from C# for fetch record but its return with 30 days old record from provided timeOffset.

serviceUrl1 = " https://api.hubapi.com/contacts/v1/lists/recently_updated/contacts/recent?hapikey=demo&property=email&property=lifecyclestage&count=100&timeOffset=1446767961000"

2 Answers2

1

The Hubspot API doesn't directly support specifying a time-range for updates: it returns the latest results first, and the timeOffset and vidOffset parameters are used for paging through the results back in time (max. 100 per call).

If I've understood correctly that you want to retrieve contacts that have been updated in the last day, you should do the following:

  • Call /contacts/v1/lists/recently_updated/contacts/recent?hapikey=demo&count=100 to retrieve the most recent results.
  • Perform the following test on the response:
    • Is "has-more": true ?
    • AND Does the last result have a properties.lastmodifieddate.value which is less than one day ago ?
  • If so, take the timeOffset and vidOffset values and add them to the URL, which will return the next page of (older) results. Repeat the test above, adding the results from each successive call to one big list.
  • When the test is false your work is done: be sure to only add results that are less than a day old to your list of results (as the call will also return older ones if there are any!).
decates
  • 3,406
  • 1
  • 22
  • 25
0

There is a third party solution that can help you here with filtering contacts by “Last Modified Date” field on export. It is Import2 Wizard whereafter you set it up for the first time you also have the option of scheduling the export using the automation feature if you wish.

Disclaimer: I am with the Import2 team

Jana Band
  • 11
  • 2