I have a question regarding the usage of the API. We have an application in which we want to synchronize all companies with their contacts from the hubspot API of our client. The goal is that the HubSpot database acts as a single source of truth for our application.
Right now we do so by recursively calling GetAllCompanies until we retreived all the companies. This is done in about 40 calls, as there seemingly is no way to retreive a full list. As, understandably, the API is throttled this process takes at least 4 seconds to complete.
The problem occurs when trying to fetch all of these companies’ contacts. As we’re talking about more than 4000 companies, we need to do 4000 calls to retrieve all contact details per company. This makes the synchronization process very slow due to the earlier mentioned throttling (we’re talking about minutes now).
When looking into the api documentation I can not find a method to do this more efficiently:
- I could not find a way to fetch the companies with their contacts in one call instead of paginated.
- Retrieving only the modified results from the past 30 days most likely will return a dataset that is about the same is size as the company will be very active.
Is there something I’m overlooking? What would be the best practice in this case?