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.