Read Records with $top and $skip Options¶
To demonstrate how to send a simple GET
request and obtain the corresponding response, the BusinessLeadHandling
projection is used here.
Before you Begin
- Obtain the access token by following the steps given in the Authentication page.
- Make sure the user you used while obtaining the access token, has the permission set granted to access the
BusinessLeadHandling
projection used in the quick start. To do this, first, let's create a permission set.- Navigate to Solution Manager > Users and Permissions > Permission Sets.
- Click on the + icon and create a new permission set as shown below.
- Tick the checkbox corresponding to the newly created permission set and click Details.
- Select Projections from the left navigation.
- In the Granted Projections panel, click Add/Revoke and select Add from the dropdown that appears.
- Filter by the projection name,
BusinessLeadHandling
. - Tick the checkbox and click OK.
- Select Users Granted from the left navigation.
- In the Users Granted panel, click Add Users.
- Filter using the same user name you used while you created the client for the authentication process .
- Click OK.
In IFS Cloud¶
-
Navigate to Solution Manager > Integration > API Explorer. Alternatively, search for
API Explorer
in the search bar. -
Filter by API Name,
BusinessLeadHandling
. -
Navigate to the API Documentation as shown below.
-
In the API documentation, select
BusinessLeads
on the left navigation and click onGet entities from BusinessLeads
. -
Copy the URL provided in the right panel.
In Postman¶
Simple GET Request¶
-
Open a new GET request and paste the URL you copied from the API Doc in the previous step as the Request URL.
-
Make sure that the header tab has an Authorization key with the value in the format of
Bearer <access token>
as shown below. This is the access token you obtained while authenticating the request.
- Click Send
You will now see the entities listed in the response.
GET Request with $top Option¶
The $top
query option is used when only a certain number of records are required to be listed. This enables efficiently handling the amount of data retrieved from the server.
Let us assume that only a limited number of records are required from the entity list obtained in the response above.
Modify the simple request URL above by adding ?$top=1
. On pressing send, the response will only contain the first record.
GET Request with $skip Option¶
The $skip
query option is used when a number of records need to be skipped from the response obtained.
Let us assume that the first three records in the entity list are not required to be displayed.
Modify the simple request URL above by adding ?skip=3
. On pressing send, the response skip the first three records and display starting from the fourth record.
Combining $top and $skip Options¶
Multiple query options can also be used for the same request URL.
Below is an example where the response will skip the first three records and then stop displaying after the next two records. That is, only the fourth and fifth records will be obtained in the response.