Deal API not returning all values within since range

deals

#1

I am trying to get 100 after a certain date.
However, it always only returns the most recent for this month and none of the others.

Here is the GET request.

https://api.hubapi.com/deals/v1/deal/recent/created?count=100&offset=0&access_token=XXXXXX&since=1438473600000

Why is this happening?


#2

It only can return the most recent month? What is the point in having since then?


#3

@Wyatt_Benno Yes here is the note in the documentation.

Note: This endpoint will only return records created in the last 30 days, or the 10k most recently created records. If you need to get all of your deals, please use this endpoint.

The endpoint it is referring to is:

You can page through all your deals and filter it by create date to get deals that span more than 30 days.


#4

@pmanca Thank you. I realize the other endpoint exists. I want to get the most recent 500 extended further back then the first month. When I use the “all” endpoint it gives different return values. How do I get the same values as the “recent” api endpoint using the “Get all deals” endpoint?


#5

@Wyatt_Benno If by return values you mean that you are looking for specific properties then you could use the properties parameter,

Properties …&properties=x&properties=y…


#6

@pmanca Yes. This is what I am looking for. I have tried to use the properties parameter to return the exact same results as the “most recent api” without luck. Could you provide an example of using this to return the same values/properties.


#7

Is there a way to return them in desc order? Most recent first?


#8

@Wyatt_Benno I have one started out for you. Essentially you can append on the properties to the call you would want.

https://api.hubapi.com/deals/v1/deal/paged?hapikey=xxxxx&properties=pipeline&properties=dealname&properties=amount&properties=closedate&properties=hubspot_ownere_id&properties=hs_lastmodifieddate

If you need the most recent ones you can filter out the results afterwards in your code based on the createDate etc.


#9

@pmanca Thank you very much. I see what to do now! :relaxed: