How to get the "Timeline" data from Opportunities in the REST API?

Hi!
I’ve been trying to gather data from a client of mine to build a dashboard of sorts, but as I was looking into the API, the module Opportunities doesn’t have a field or relationship called “timeline”, “records”, “history” nor anything alike.
It’s important to me to know when a deal moved from stage to stage in the pipeline.
On the right side of this picture there is a “Timeline” with stage, user and date, but I can’t find this information through the API.


Could anyone show me this information in a json response, and what did you do to get it?

Isn’t it part of opportunity record?

No, not in the V8 API at least, I’ve read through your link and through the docs for V4_1 and haven’t found anything alike as well, except for the fact that I would need an username, password and a session_id, instead of the V8’s access_token.

To fetch timeline data, you must fetch each related module separately.

Hello Rafael,

these are calculated / retrieved from different DB tables.
The one you’re pointing out is in:

SELECT * FROM `opportunities_audit`

How are you building the dashboards? Via the CRM Reports?
In that case, you’d have to build history / KPI modules and write your data into those custom modules. Then you can build reports on top of your custom modules.

If you use PHP / Metabase or similar, you’d just connect to the correct DB tables and build the reports there directly.

API wise: best to go forward, not backward. I’ve not tried it, but you can check out GraphQL API to see whether you can retrieve the audit records in that way.

1 Like