Skip to content

Read Records with Filter Options

To demonstrate how to send a GET request with the filter option enabled and obtain the corresponding response, the BusinessLeadHandling projection is used here.

Here, we call an endpoint that lists the entities from business leads based on a given condition.

Note - If you are here to try this out right after trying out the Simple GET Request, skip to the Get Request with Filter Option section below.

Before you Begin
  1. Obtain the access token by following the steps given in the Authentication page.
  2. 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.
    1. Navigate to Solution Manager > Users and Permissions > Permission Sets.
    2. Click on the + icon and create a new permission set as shown below. create_permission_set
    3. Tick the checkbox corresponding to the newly created permission set and click Details.
    4. Select Projections from the left navigation.
    5. In the Granted Projections panel, click Add/Revoke and select Add from the dropdown that appears.
    6. Filter by the projection name, BusinessLeadHandling.
    7. Tick the checkbox and click OK.
    8. add_projection_to_set
    The required projection will be added to the permission set as shown above. Now let us add the user to this permission set.
    1. Select Users Granted from the left navigation.
    2. In the Users Granted panel, click Add Users.
    3. Filter using the same user name you used while you created the client for the authentication process
    4. Click OK.
    5. users_granted

In IFS Cloud

  1. Navigate to Solution Manager > Integration > API Explorer. Alternatively, search for API Explorerin the search bar.

  2. Filter by API Name, BusinessLeadHandling.

  3. Navigate to the API Documentation as shown below.

simple_get_apidoc

  1. In the API documentation, select BusinessLeads on the left navigation and click on Get entities from BusinessLeads.

  2. Copy the URL provided in the right panel.

simple_apidoc_page

In Postman

Read Records with Filter Options

Let us assume that only leads with a turnover greater than 100 should be obtained in the response.

  1. Open a new GET request and paste the URL you copied from the API Doc in the previous step as the Request URL.

  2. Modify the above URL by adding ?$filter=Turnover gt 100

filter

  1. 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.

  2. Click Send

You will now see only the leads with a turnover greater than hundred.

get_filter_response

Filter Option on an Enumeration

Let us assume that only records whose state is Converted are required in the response. The object state (Objstate) is of enum type enabling it to contain a set of predefined values including Converted that we require.

In order to get the expected output, the query option should be in the following format: ?$filter= variable-name eq IfsApp.Projection-name.Enum-name'value-required'

Note - The enumeration name and its values can be found in the API Doc for the LeadBusinessHandling projection.

enum_apidoc

The request will be as follows:

filter_enum

The response will be as follows:

enum_response

Filter Option on Date

Suppose we only need the leads that were created on a certain date. The date is generally represented in the YYYY-MM-DD format.

In the example given below, we are only filtering the lead/s that was created on the 20th of March 2015.

filter_date

The response will be as follows:

filter_date_response