Return data of modified fields within pipeline


#1

Inside deals, we have sales pipeline. With the API URL https://api.hubapi.com/deals/v1/pipelines,
I just get the structure of the pipeline, i.e. we have Targets, Warm leads, basic subscription, proposals..etc.
But it doesn't return the data of the companies, that are listed within the pipeline.

Precisely I need the names of the companies, when deals were changed.

For example in this month, 5 companies were moved from basic to proposal. I want to get the names of those companies.

How can we do this?


#3

Welcome, @latika.karnani,

The Deal Pipelines API is deprecated, so I recommend using the CRM Pipelines API going forward.

That said, neither of these pipeline APIs will return data about companies — they will only return data about pipelines. You must use a couple different APIs because pipelines, companies, and deals are different objects.

The Get recently modified deals endpoint, however, returns associatedCompanyIds. You can then use these companyId values to get the company name property value from this Companies API endpoint.


#4

Awesome. this gives me a great start. Thank you Issac. I have one question regarding this. If I want https://api.hubapi.com/deals/v1/deal/recent/modified&since=x
where x would be present - 30 days, how do we do this in unix time format here?


#5

Another question,


Even if I am able to extract the associated company IDs of modified deals like this, how will I dynamically put those IDs in the Company API endpoint which goes in data source?


#6

Hi @latika.karnani,

For your first question, you could calculate that timestamp by using a function like Date.now() and then subtracting 2592000000, which is 30 days in milliseconds. You would then use this resulting timestamp as the value for since.

I'm not sure what you mean by your second question. If you get all the company IDs, you can use a for loop to loop through every ID returned, store the value(s) in a variable and then use that variable to populate the request URL for this endpoint. If the for loop is built correctly, it should call the endpoint for every company ID. Each request will return data for that company record, from which you can retrieve the value of the name property. You can then surface the company name so that users know which companies are associated with a deal.


#7

Hi Isaac,
I understand the process. Have you worked with Klipfolio before?
I don't think we can pass a value in the API URI for since=,
nor can we loop through the results in a variable and assign the value in the URL request for the endpoint.


#8

Hi @latika.karnani,

I have only worked with Klipfolio in this limited capacity.

Why don't you believe you can populate timestamps in a request URL and then loop through the results?

Both of these are possible (see this discussion and this thread, for example), so please be specific with the issues you are encountering.


#9

Got it. Thanks Issac.
If anyone in future reading this,
check this out https://support.klipfolio.com/hc/en-us/articles/216182487-MAP-function