Get detailed status history/ticket activities of a Freshdesk ticket via API

In the Freshdesk web interface you can show/hide a ticket’s activities, i.e. its status history etc. In the API documentation I can’t find anything about this. Is it possible to retrieve a ticket’s history, specifically the timestamps of its status changes, via the API? We would like to analyse for how long tickets stayed in each status.

Hello @florian.ziegler,

You maybe able to see what you are looking for by embedding “stats” in the url when you make your api request.

Another option is to use Time Entries for tickets.

Just a couple ideas to try. Hope this helps :slight_smile:

Hi Zach,

we’re already using the include=stats parameter, but that doesn’t give us the timestamps of each status change. I also found the Time Entries but that’s not really feasible for us.

So, assuming that the detailed status history of a ticket cannot be retrieved through the API right now, I’m hereby submitting this as a feature request :slight_smile:

Yes it would be nice if we could access ticket activities. Right now, in freshservice (not sure if it is the same in freshdesk) we can only get the ticket activity information via an export button from within the ticket. Which is very tedious, since you can only do one ticket at a time. A feature request is a great idea! :+1:

Hey Florina and Zach,

Have you checked this out? We provide an API end point to export the ticket activities data periodically!

3 Likes

Hello @Ganesh_Balaji,

This is a fantastic start, but is it available as an API endpoint for Freshservice as well? If not, I would like to suggest opening up this endpoint for the freshservice API as well. Thank you! :slight_smile:

1 Like

I would also love an API endpoint to see all status changes of a ticket. Returning something to the effect of:

  • Record
    • State: open
    • Timestamp: [TIMESTAMP]
    • By: [customer]
  • Record
    • State: pending
    • Timestamp: [TIMESTAMP]
    • By: [Agent]
  • Record
    • State: resolved
    • Timestamp: [TIMESTAMP]
    • By: [Agent]
  • Record
    • State: open
    • Timestamp: [TIMESTAMP]
    • By: [customer]

etc, etc

1 Like

Still no movement on this request… is there really no way to use API endpoints to retrieve a ticket’s full activity history, as described in this thread?

Thanks for bumping this, @spencerwilliamz.

Looks like this did not get any attention so far. I have asked the Freshdesk API team for details on this. I will update this thread once I have some response.

Bumping this again. Still no API endpoint for this? The capability is obviously built as we can see the ticket activities in the web interface per ticket, I would think that it shouldnt be to much of a stretch to extend that capability into an API endpoint, no? The web interface looks like it uses the endpoint:

https://dan-help.freshdesk.com/api/_/tickets/10/activities

That looks like it has all the data you could want, probably even more. So maybe a trimmed down response and make it available at"

https://dan-help.freshdesk.com/api/v2/tickets/10/activities

This cant be to much of a stretch to make happen is it?

1 Like

I’ve been working around the issue. It’s messy, but works if you have the time.

If you run the URI “…/activities?”

You get a list of the latest 30 activities.

You can create a while loop to then take the last one in the list and run the following URI. For example: “…/activities?before_id=$lastActivityId”

That will give you the next 30. You can use the while loop to do a certain number of times or until there’s no more IDs, etc.

I can’t find the “before_id” anywhere in their documentation, so I have no idea what other options there are. Perhaps a “top” or something exists, I haven’t tried… or even by_performer.

Either way, building out that API endpoint or at least documenting what’s there woudl be nice.

Hey @tg2024
That endpoint does work on the browser. But I want to automate the requests using python. I keep getting 403 (not authorized) when requesting the endpoint.

I was using an admin accounts APIKEY. I am keen to know how you are making the requests.

@Henok
I used this path: api/_/helpdesk/activities?

I used a web session for access, via a PowerShell script. It will work exactly the same way with Python.