Skip to main content

Handling Massive Requests

When dealing with large datasets, it's crucial to efficiently manage the retrieval of data to ensure performance and resource optimization. One common approach to achieve this is by utilizing the Skip and Take parameters in your API requests. These parameters allow you to paginate through your data, fetching manageable chunks of records at a time.

Parameters Description

Skip: This parameter defines the number of elements to bypass. It effectively tells the system how many records to ignore from the beginning of the dataset. This is particularly useful when you have already processed a certain number of records and need to move to the next set.

Take: This parameter specifies the number of elements you wish to retrieve in a single request. By limiting the number of records fetched at one time, you can prevent overloading your system and ensure smoother data processing.

Practical Example

Using POST Method

Let's consider a scenario where you need to process contact records in batches of 50. Initially, your Skip and Take parameters would be set as follows:

  • Skip: 0 (Since no records have been processed yet, start from the beginning)
  • Take: 50 (Fetch the first 50 records)
{
"Skip": 0,
"Take": 50
}

Once you have processed these 50 contact records, you will need to fetch the next batch. To avoid retrieving the already processed contacts, you adjust the Skip and Take parameters for the subsequent request:

  • Skip: 50 (Skip the first 50 records that have already been processed)
  • Take: 50 (Fetch the next 50 records)
{
"Skip": 50,
"Take": 50
}

This process of adjusting the Skip parameter while maintaining the Take parameter allows you to efficiently paginate through your data without redundancy.

Using GET MEthod

<!-- First Request -->
GET /api/[url/endpoint]?skip=0&take=50

<!-- Second Request -->
GET /api/[url/endpoint]?skip=50&take=50

Max Number of elements

The maximum number of elements that can be returned by the API using skip and take is 300.