How to get the next page URL in pagination?

Hi,

I referred to Freshdesk. I need to use pagination to retrieve all agent’s details. So, I tried like below
https://sample.freshdesk.com/api/v2/agents?page=1 and got the first 20 agents in page number 1 and also I have given the header as follows:
link: https://sample.freshdesk.com/api/v2/agents?page=2;rel=“next”

But I couldn’t get the next page URL in the response as in the document. Please help me to resolve this.

1 Like

Hi @Dineshkumar_Ravichan,

In order to get pagination data, I think you need to send a request as Freshdesk doesn’t support pagination through header data.

So in your case check the returned response data from Freshdesk, if the returned array length is greater than 0 (i.e, the returned response array has data) call the function recursively until the returned array length is 0.

Thanks,
Arshath

2 Likes