APIs & Integrations

SQUEZZOO
Member

Get associated deal ID using contact IDs

SOLVE

Hi, I need to get an associated deal ID by giving the contact ID. I didn't find an endpoint about that. Can anybody help me?

0 Upvotes
1 Accepted solution
TomAshford
Solution
Participant | Platinum Partner
Participant | Platinum Partner

Get associated deal ID using contact IDs

SOLVE

Hi,

 

On all of the below replace CONTACT.ID & HUBSPOT_API_KEY with your real values. Depending on the API version you're using:

 

Using the latest v4 API it would be the associations endpoint:

 

https://api.hubapi.com/crm/v4/objects/contacts/CONTACT.ID/associations/deals?hapikey=HUBSPOT_API_KEY

 

Documentation here

 

Using v1 or v3 API:

 

https://api.hubapi.com/crm-associations/v1/associations/CONTACT.ID/HUBSPOT_DEFINED/4?hapikey=HUBSPOT_API_KEY

 

https://api.hubapi.com/crm-associations/v3/associations/CONTACT.ID/HUBSPOT_DEFINED/4?hapikey=HUBSPOT_API_KEY

 

"4" in these URLs is the ID for contact_to_deal as outlined here:

https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview

 

Documentation here

 

These all return JSON with a list of associated deal IDs, slightly different formatting between v4 & v1/v3 but both return the IDs.

 

Hope that helps.

 

Cheers,

Tom

View solution in original post

1 Reply 1
TomAshford
Solution
Participant | Platinum Partner
Participant | Platinum Partner

Get associated deal ID using contact IDs

SOLVE

Hi,

 

On all of the below replace CONTACT.ID & HUBSPOT_API_KEY with your real values. Depending on the API version you're using:

 

Using the latest v4 API it would be the associations endpoint:

 

https://api.hubapi.com/crm/v4/objects/contacts/CONTACT.ID/associations/deals?hapikey=HUBSPOT_API_KEY

 

Documentation here

 

Using v1 or v3 API:

 

https://api.hubapi.com/crm-associations/v1/associations/CONTACT.ID/HUBSPOT_DEFINED/4?hapikey=HUBSPOT_API_KEY

 

https://api.hubapi.com/crm-associations/v3/associations/CONTACT.ID/HUBSPOT_DEFINED/4?hapikey=HUBSPOT_API_KEY

 

"4" in these URLs is the ID for contact_to_deal as outlined here:

https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview

 

Documentation here

 

These all return JSON with a list of associated deal IDs, slightly different formatting between v4 & v1/v3 but both return the IDs.

 

Hope that helps.

 

Cheers,

Tom