A LinkedIn article by one of our very own:
The Samanage REST API makes it easy to create applications and integrate business systems with Samanage Service Platform. In certain cases such an integration require going over very large number of records in order to get the job done. This may take quite a while if there are many records to retrieve (e.g. audit records). It is also an inefficient operation if integration code retrieves all the needed records anew when new records are created or added. The recommended approach in such cases would for the integration code to store what has already been retrieved and retrieve only newer records when processing is required.
This article describes a method to do just that: Each execution of the implementation shown below retrieves only records not already retrieved by previous executions.
Here is a Java script library that Eetay put together