APIs & Integrations

YFeng
参加者

How to get newly created Contacts and their associated Deals

解決

Hello experts,

 

My use case is to Get all contacts that were created every 5 mins and return the contacts and their associated Deals properties. I can get all Contact properties, but I wonder how to get all Deals properties that are associated with those newly created contacts. So is this correct? 1. Make an API call first to associate Contacts and Deals. 2. Make another call to get the newly created Contacts and their associate Deals. What is the second step request should look like? I used the Search Contact API but what should be the filers? 

 

YFeng_0-1621018559986.png

 

 

Thanks,

Yvonne 

 

0 いいね!
1件の承認済みベストアンサー
zaklein
解決策
投稿者 | Diamond Partner
投稿者 | Diamond Partner

How to get newly created Contacts and their associated Deals

解決

Hi @YFeng 

Unfortunately, the Search CRM endpoint does not support the "associations" parameter in the query string (not all HubSpot API endpoints support the same query string parameters - you'll need to check each endpoint individually using HubSpot API docs). As such, you'll probably have to perform a couple more API calls than you were originally expecting. Based on how you've described your case, here's an option you may like to pursue (assuming the Contact records are already associated with the relevant Deal records):

  1. Perform a CRM Search to return recently created Contacts (as per the screenshot you've already shared)
  2. Use the returned Contact IDs from Step 1 to "read a batch of associations"
  3. Use the returned Deal IDs from Step 2 to "read a batch of deals by internal ID" (you'd specify your target Deal properties within the query string of this request)

I hope that's helpful. Let me know if you have any follow up questions.

All the best,

Zach

元の投稿で解決策を見る

2件の返信
zaklein
解決策
投稿者 | Diamond Partner
投稿者 | Diamond Partner

How to get newly created Contacts and their associated Deals

解決

Hi @YFeng 

Unfortunately, the Search CRM endpoint does not support the "associations" parameter in the query string (not all HubSpot API endpoints support the same query string parameters - you'll need to check each endpoint individually using HubSpot API docs). As such, you'll probably have to perform a couple more API calls than you were originally expecting. Based on how you've described your case, here's an option you may like to pursue (assuming the Contact records are already associated with the relevant Deal records):

  1. Perform a CRM Search to return recently created Contacts (as per the screenshot you've already shared)
  2. Use the returned Contact IDs from Step 1 to "read a batch of associations"
  3. Use the returned Deal IDs from Step 2 to "read a batch of deals by internal ID" (you'd specify your target Deal properties within the query string of this request)

I hope that's helpful. Let me know if you have any follow up questions.

All the best,

Zach

dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

How to get newly created Contacts and their associated Deals

解決

@zaklein , any chance you could help out here?

0 いいね!