I tried to use the API SDK for the first time in a data-sync use case, and I found that we need to be able to pass response headers back to the user. Currently, we ignore headers and just send the response data as objects.
But, consider this, when calling GET /employees, pagination details are sent using the response headers total-objects, total-pages and link (URL to the next page). So, if I am running a scheduled function that syncs the list of Freshteam employees to another system, then the scheduled function needs to remember the link or the total-pages value to fetch the next page.
I tried to use the API SDK for the first time in a data-sync use case, and I found that we need to be able to pass response headers back to the user. Currently, we ignore headers and just send the response data as objects.
But, consider this, when calling
GET /employees
, pagination details are sent using the response headerstotal-objects
,total-pages
andlink
(URL to the next page). So, if I am running a scheduled function that syncs the list of Freshteamemployees
to another system, then the scheduled function needs to remember thelink
or thetotal-pages
value to fetch the next page.