Freshdesk api call returning limited number of tickets

Question:

I’m trying to fetch ticket details using requests library of python. Here is the command.

r = requests.get("https://"+ domain +".freshdesk.com/api/v2/tickets?updated_since=2015-01-19T02:00:00Z", auth = (api_key, password))

But, I’m just getting latest 30 tickets details.

I tried changing the date and also tried removing it, but nothing seems to work and everytime only last 30 tickets details are coming.

Asked By: Shiv Rajawat

||

Answers:

It’s due to pagination limit set by Freshdesk.

Refer: https://developers.freshdesk.com/api/#pagination

The ‘link’ header in the response will hold the next page URL if exists. If you have reached the last page of objects, then the link header will not be set.

Example:

Headers:
"link":< https://domain.freshdesk.com/api/v2/tickets?filter=all_tickets&page=2>;rel="next"
Answered By: HS_

100 per page is very less compared to 8000 that Jira Service Desk can handle. Freshdesk APIs are still primitive and when I checked with their support, I was told that we have to live with what Freshdesk provides and find our own ways to improvise.

I’m looking at fetching all tickets nearing SLA breach and apparently there is no way to get this through APIs. I have to look at all open tickets, 100 at a time to get this list.

Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.