APIs & Integrations

MGranadosAria
Participant

Automatic associations between Deals and Contacts

Hi! 
I've been creating a code to make automatic associations between Deals and Contacts, it works. However, I can only get up to 100 contacts, if I increase the limit the API's response is 400. 
Does anyone know if it is possible to retrieve every Contact? 
We have more  than 400 000 contacts and we need to associate deals to them. 


Thanks for the help

0 Upvotes
2 Replies 2
MGranadosAria
Participant

Automatic associations between Deals and Contacts

Thanks!! I'll check those solutions

0 Upvotes
MAC-MCB
Contributor | Platinum Partner
Contributor | Platinum Partner

Automatic associations between Deals and Contacts

Hi @MGranadosAria

Your issue of encountering a 400 error beyond 100 contacts arises due to HubSpot’s limitation on batch operations. However, you have two viable methods to work around this limitation:

  1. Pagination:

    • Implement pagination in your code to process contacts in batches of 100, associating deals page by page until all contacts are handled.
  2. Export API:

    • Utilize HubSpot's new Export API to export all your contacts at once. Once the export is complete, you'll receive a URL to download the exported file. Download this file and save it locally. In your code, implement file reading functionality using libraries such as fs in Node.js to read the exported data from the saved file. Process the read data to associate deals to the contacts as per your existing logic.

Each method caters to the retrieval and processing of over 400,000 contacts, aiding in the automatic association between Deals and Contacts as per your requirement.

Best Regards

Martin Christiansen

 

www.mcb.dk

Tlf.: 7012 4816 . Mobil: +45 93 63 04 95

0 Upvotes