Retrieve Deals By Date for a Contact via REST API

colinlongworth
Member

Hi All,

W

e are currently retrieving deals for a given contact via:

 

/crm-associations/v1/associations/{contact_id}/HUBSPOT_DEFINED/4

 

The issue, however, is that this endpoint returns oldest deals first. It has a limit and offset parameter, but no ORDER BY

 

Docs: https://developers.hubspot.com/docs/methods/crm-associations/get-associations

 

In other words, how do we retrieve deals for a given contact by the creation or last update date?

 

Thanks!

0 Upvotes
1 Reply 1
WendyGoh
HubSpot Employee

Hi @colinlongworth,

 

Currently, the Get associations for CRM object endpoint doesn't support sorting. For this, your team can look into implement the array sort() method - Array.prototype.sort() - JavaScript | MDN

 

So that the biggest id (latest deal) would return first in the array. 

0 Upvotes