APIs & Integrations

josh1
メンバー

Latest deal for contact?

解決

Hi, I'm looking to get the latest deal for a contact, if I use crmAssociations to get the deal ids for a contact can I assume that the largest deal id is the latest? Or is there another way I should go about this? Thanks!

0 いいね!
1件の承認済みベストアンサー
tominal
解決策
ガイド役 | Solutions Partner
ガイド役 | Solutions Partner

Latest deal for contact?

解決

You could gather all of the associated Deal IDs into an array, batch read those deals, then sort through them looking for the most recently updated deal. You can specify different properties to return in order to fit your definition of "latest."


Here are the docs on that in case you're interested in that route /crm/v3/objects/deals/batch/read https://developers.hubspot.com/docs/api/crm/deals


Hope that helps.


Thomas Johnson
Community Champion


Kahu Software LLC
A Texan HubSpot consulting firm
https://kahusoftware.com

元の投稿で解決策を見る

2件の返信
tominal
解決策
ガイド役 | Solutions Partner
ガイド役 | Solutions Partner

Latest deal for contact?

解決

You could gather all of the associated Deal IDs into an array, batch read those deals, then sort through them looking for the most recently updated deal. You can specify different properties to return in order to fit your definition of "latest."


Here are the docs on that in case you're interested in that route /crm/v3/objects/deals/batch/read https://developers.hubspot.com/docs/api/crm/deals


Hope that helps.


Thomas Johnson
Community Champion


Kahu Software LLC
A Texan HubSpot consulting firm
https://kahusoftware.com
dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

Latest deal for contact?

解決

@josh1 

They do generally increment, but I would avoid making assumptions like this.

Might be worth exploring the CRM Search where you can sort.  @tominal , what do you think?

0 いいね!