We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
May 18, 2022 12:05 AM
Dear Hubspot Community,
I am new to Hubspot and I am trying to use the APIs for getting all deals. When I retrieve my deals, I also want to retrieve the associated contact details with each deal. I have also read the CRM association API, but I am not sure how I can use it through API. If anyone knows about it, please guide me, I have been stuck here for a few days.
I would greatly appreciate any assistance.
Thank you!
Solved! Go to Solution.
May 18, 2022 3:55 AM - edited May 18, 2022 3:56 AM
Hi @Fawad,
If you want to get the contacts associated with each deal, you will have to (in order) :
/crm/v4/objects/DEALS/{DEAL_ID}/associations/CONTACTS
This call above will get your all the contacts associated to the deal whose id is {DEAL_ID}.
{
"filters": [
{
"value": "string",
"values": [
"string"
],
"propertyName": "hs_object_id",
"operator": "IN"
}
]
}
This is the "simple" way of doing what you want to do.
Of course you can speed this up by using batch calls instead of iterating on the deals one by one.
There's a good solution provided in another thread, and I would recommend this approach.
Hope this helps !
If it does, please consider marking this answer as a solution 🙂
Best,
Ludwig
![]() | CTO @ Mi4 Hubspot Platinum Partner and Integration Expert Passionate human, very curious about everything data and automation. Any problem with Hubspot you need help solving ? Let me know ! |
May 18, 2022 3:55 AM - edited May 18, 2022 3:56 AM
Hi @Fawad,
If you want to get the contacts associated with each deal, you will have to (in order) :
/crm/v4/objects/DEALS/{DEAL_ID}/associations/CONTACTS
This call above will get your all the contacts associated to the deal whose id is {DEAL_ID}.
{
"filters": [
{
"value": "string",
"values": [
"string"
],
"propertyName": "hs_object_id",
"operator": "IN"
}
]
}
This is the "simple" way of doing what you want to do.
Of course you can speed this up by using batch calls instead of iterating on the deals one by one.
There's a good solution provided in another thread, and I would recommend this approach.
Hope this helps !
If it does, please consider marking this answer as a solution 🙂
Best,
Ludwig
![]() | CTO @ Mi4 Hubspot Platinum Partner and Integration Expert Passionate human, very curious about everything data and automation. Any problem with Hubspot you need help solving ? Let me know ! |