APIs & Integrations

jeeshenlee
Contributor

How to search Deals with its properties 'closedate' that falls between a date range

SOLVE

I’m getting deals from GET /deals/v1/deal/paged and wanted to know how do I get only the list of deals with closed date falls between a date range (e.g. between 01.Jan.2018 to 31.Jan.2018).

On top of that, does the API support fields sorting?

Thanks.

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

How to search Deals with its properties 'closedate' that falls between a date range

SOLVE

Hi @Tom_Mitchell,

The Get associated deals endpoint does not support the objectType "lists." Per the documentation, only contact or company can be used.

To get all deals associated with the contacts in list 930, you must first use this endpoint and loop through each returned vid.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
4 Replies 4
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

How to search Deals with its properties 'closedate' that falls between a date range

SOLVE

Hi @Tom_Mitchell,

The Get associated deals endpoint does not support the objectType "lists." Per the documentation, only contact or company can be used.

To get all deals associated with the contacts in list 930, you must first use this endpoint and loop through each returned vid.

Isaac Takushi

Associate Certification Manager
0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How to search Deals with its properties 'closedate' that falls between a date range

SOLVE

Hi @JeeShenLee,

The deals API doesn’t currently support filtering/sorting. What you could do is create a smart list of contacts that have an associated deal that closes within a particular timeframe, pull the contacts in that list, then get the deals associated with those contacts. This would likely be more efficient than other methods, like pulling all deals.

tommitchell
Contributor

How to search Deals with its properties 'closedate' that falls between a date range

SOLVE

Hi there, I'm trying to achieve this too with the following API request (looking to pull in all deals associated with contacts in list id 930) but not having much luck, could you let me know where I'm going wrong please? Thank you!

https://api.hubapi.com/deals/v1/deal/associated/lists/930/

0 Upvotes
jeeshenlee
Contributor

How to search Deals with its properties 'closedate' that falls between a date range

SOLVE

@Derek_Gervais thanks!

Never thought of using smart list.