I’m trying to get the number of activities per stage, but it seems there is no way to get the stage_id in the activity endpoint.
So I just wanted to confirm whether it’s really impossible or if someone has figured out a workaround?
Thanks a lot
Welcome to the community As you would have noticed from the documentation, About the Pipedrive API
Deals are part of pipelines and (thereby stages). Activities do not directly belong to any stage and the association is through the deal data. If you are looking for this association, you can use the following endpoints to retrieve the required data.
Let me know if this helps
Thanks a lot for getting back to me.
The point of the analysis I’m working on is to assess how much effort is required to move a deal from one stage to another. And the proxy I’d like to use is the number of activities.
Now that you confirm that the API doesn’t allow for an easy way to get the number of activities broke down by stages, do you maybe have any workaround in mind that could help?
One workaround I thought of is to use to use the activity & stage date fields, but it would require a lot of modelling so I’d rather go this route in last resort.
Unfortunately, there is no workaround for this. The data has to be joined (via tools or via code) so that you can see the association
You are right. This could be complicated. I shared some thoughts related to that here
Usually /GET API endpoints allow you to obtain the necessary data pertaining to an entity(Deal/Lead/Contact/Person/etc). Sometimes, there might be a need to combine data from different endpoints (and thereby different entities). In such situations, the following can be done:
Check if the API endpoint response has related_objects property or support for associations
Leverage the search_for_related_items via the item search endpoint
Combining the data in runtime or via a custom API