Reports about deal and activities

I would like to make a custom reports about average time between first two activities in deal for given period of time (week, month, quarter) and looking for best way to achieve that having in mind speed of response and amount of requests. Some ideas? It should return all kind of deals, not only open and won.

I’ve try to get it by

  • /deals/timeline with period, filter_id and field_key named ‘add_time’
  • then for every deal I ask for /deals/{id}/flow and looking for activities or /deals/{id}/activities

But I wondering if there is fastest way to get this. Grateful for any tips

Hi :slight_smile:

To get all the deals created in a specific time frame you can use the /searchResults/field endpoint, with the following parameters:

field_type: dealField
field_key: add_time
return_item_ids: 1
term: 2019-01

That call will return all the deals added in January. If you want you can also specify the day (eg 2019-01-23).

So, to get the report you need for December 2018 - January 2019, you would make:

  • One call to /searchResults/field with term 2018-12
  • One call to /searchResults/field with term 2019-01

And for each deal coming from those two requests, you can call (as you pointed out) /deals/{id}/activities to find the first two ones added.

It’s a few requests but it should be pretty straight forward.

As an alternative, you could also export the data you need manually and operate on a csv.

Does that help?

Hi @dani
thanks for response. Your solution gives me deals from certain periods like month or a day and this is not good for my report. I’ve ended up with three filters (with periods: last week, last month, last quarter) and call to /deals with filter_id pointed to those filters. And then do the /deals/{id}/activities call. So it takes 2 calls also just like in your solution. I don’t see better ways like yours and mine.

Yeah, that also works. I think they both are fine :slight_smile:
If you come up with something better let us know.