Recently Updated API Use -- Need Help


#1

When getting back updated HubSpot Contacts into our system and updating our system records.

We have a query in a case “When getting back updated HubSpot Contacts into our system and updating our system records.”

Suggested API is: http://developers.hubspot.com/docs/methods/contacts/get_recently_updated_contacts
This API returns record in pagination. Each call will return 100 records and then passing vidOffset will fetch next 100 records.

Let’s assume we have 10k records on Hubspot.

Person A: update a field of each candidate ranging from 1 to 100 per day
Person B: update a field of each candidate ranging from 101 to 200 per day
Person C: update a field of each candidate ranging from 201 to 400 per day
Person D: update a field of each candidate ranging from 401 to 500 per day
Person E: update a field of each candidate ranging from 501 to 700 per day

Now, as per API it returns the last updated records first and in a set of max 100 per call.
If last updated record offset was, say 650, it will return next 100, and the offset passed to api on its next call will be 550. and it will traverse till vid Offset is 0 back again. Vid Offset when 0, it will fetch again the recent updated or created records.

Now, a Person F: update a field of each candidate ranging from 701 to 800 same day. and added a new record 801 also.

but our running API would be fetching records from 550 and go downwards to 300… and the loop continues to 1 or when the has-more condition is 0.
Question is, How should we get the records updated and added by Person F and get updated back as soon as possible in our system.
Do we need to wait till the end of the loop and then start again with Offset with 0 to get latest record…
If records are like 50k in coming months, then how long will it take to get back the recent updated or newly added records back in our system.

Please share your thoughts and options we have.
Please do reply.

Please do reply.

Regards,
Vipul


#2

Hi @vipul

The recently updated endpoint starts with the most recently updated records (i.e. the last records to be updated) and then pages backwards to less recently updated records. The vidOffsets you get will not be sequential, and you’d need to use both the vidOffset and the timeOffset to page backwards through the records. Any newly updated records would be added to start of the list (what you’d get without any offsets), so you wouldn’t get those records until the next time you checked for updates.

In general, you won’t want to go through all of the records you’d get from the recently updated endpoint, as that will go back 30 days, so you’d only want to go back until the last time you polled for updates.

You can find more details about how that endpoint and the offsets work here:
http://developers.hubspot.com/docs/faq/how-do-i-use-vidoffset-and-timeoffset


#3

Thank you so much for the link… http://developers.hubspot.com/docs/faq/how-do-i-use-vidoffset-and-timeoffset