It seems that API to fetch the ticket conversation will return the first 30 conversation, I need all the conversation without setting the page number in the API url, is there any way to get all the conversation
Hello,
When you hit the API endpoint, the server returns the response along with the 'link' header. It indicates if the next page exists and provides the url of the page. You can adjust your script so that the value of the link header is taken into consideration and the API call gets updated accordingly. Sample link header:
"link":< https://domain.freshdesk.com/api/v2/tickets?filter=all_tickets&page=2>;rel="next"
Cheers!
There's a few different ways, but here's a simple one:
1. Hit the endpoint with pageNumber=1
2. If the response has a length = 30, hit the endpoint with pageNumber++
3. If the response has a length < 30, stop.
what if i dont know the number of pages , how will i get all the conversation?
Just loop through all of the pages in your app. Response pagination is pretty common.
Sign in to the Community
Social Login
Login for Freshworks Employees Login with LinkedInEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.