简体   繁体   中英

Freshdesk api call returning limited number of tickets

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.

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"

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM