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.
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.
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.
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?
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.
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?