APIs & Integrations

AdamReed51
Member

Using private app to retrieve each deal stage and time

I'm looking to retrieve a list of all deals and understand each deal stage (e.g. appointment scheduled, kickoff scheduled,... closed won/lost) and the date each transition happened.  I have a list of 5k deals I need to pull this data for so the API seems to be the best solution.  For example I need to understand:

  1. Deal 123
    1. Appt scheduled == 09/09/2023
    2. Kickoff scheduled == 09/15/2023
    3. Closed Lost == 09/16/2023
  2. Deal 456
    1. Appt scheuled == 09/09/2023
    2. ...
    3. Decision Maker Bought in == 09/20/2023

I've found a few similar type of requests but was unable to get this to pull the data correctly - ideally I'd like to make a single request per deal ID, grab the relevant data and loop through each deal_id.

 

I've created a private app with  the following scopes:

  1. crm.schemas.deals.read
  2. crm.objects.deals.read
  3. timeline

After doing some searching what seems should have what I need is the endpoint:

https://api.hubapi.com/engagements/v1/engagements/associated/deal/{deal_id}/paged?include=metadata

 

The problem is while I can get a 200 response, the data is always empty:

{
    "results": [],
    "hasMore"false,
    "offset"0
}

 

Can you anyone guide me to an endpoint that would provide me with what I need?

 

Thanks

 

 

 

 

 

0 Upvotes
1 Reply 1
AdamReed51
Member

Using private app to retrieve each deal stage and time

Looks like I got it using https://api.hubapi.com/crm/v3/objects/deals/{dealId}?propertiesWithHistory=dealstage

 

This returns each stage ID insetad of name but it does give timestamps for each stage change so it's just a matter of converting the IDs to names for reporting purposes

0 Upvotes