APIs & Integrations

manojjha
Member

Relationship between Company, Deals and Contact APIs

Hi Hubspot Team,

I hope you all are well and safe during this pandemic crisis.

I am writing this post because I am not able to find the relationship between Company, Deals, and Contact APIs. My end output contains below columns:

#Deal name + Purchase order number + deal description + Contact delivery information + phone + shipping Address

So for that my idea was to use DealsAPI to get all deal ID then iterate through each Deal id and use the particular id in below end-point:

https://api.hubapi.com/deals/v1/deal/1234567891?hapikey=

from this API I want to get associatedVids:

portalId': 0000000,
 'dealId': 0000000I,
 'isDeleted': False,
 'associations': {'associatedVids': [151],

 but I am not able to fetch associatedVids because it is an array object and not normal int or text. I wanted to get this value so I can do lookup between deals API and Contact API to get Deal name + Purchase order number + deal description + Contact delivery information + phone + shipping Address

 

please help me make the relation between APIs to get the above columns.

 

Thanks,

1 Reply 1
WendyGoh
HubSpot Employee
HubSpot Employee

Relationship between Company, Deals and Contact APIs

Hey @manojjha,

 

All's well. Thank you! I hope the same for you too!

 

When looking to understand the relationship between company, deals and contact API, you can refer to this ERD diagram: HubSpot ERD.

 

For your use case, when you retrieve the contact ID in the associatedVids array, you can use the CRM v3 contacts endpoints to get more information of the contact by the contact ID. 

 

Hope this helps to shed some light!

0 Upvotes