Creating Data Services

A Data Service is a server-side object in the Session AI platform, which is used to get/post data from a defined service that is external to the Session AI platform. The defined service could be an HTTP POST, HTTP GET, or a custom service. These services are automatically invoked by the platform when they are referenced in any server-side code.

The Data Services feature allows you to create the following types of data service instances.

Creating HTTP POST Call

  1. In the Data Streams menu, click the Data Services tab.
  2. Click the CREATE DATA SERVICES located in the upper-right corner.

The system displays the types of data services.

  1. Click HTTP POST.
1457

The following screen appears.

  1. Provide the following details:
  • Service Name: Name of the data service.

  • Service Description: Description of the data service.

  • End-point URL: Enter the endpoint URL.

  • POST Payload: Create the payload body of the HTTP POST request.

  • Response Processing: Create the syntax of the response body.

  • Http Headers: Add additional parameters in the HTTP header request and click Add New Header. It should be in key-value pair.
    Example:

    • HTTP Header Name is Content-Type
    • HTTP Header Value is application/json
  1. Click Save.
1776

The following is a sample HTTP POST-Data Service.

1732

Creating HTTP GET Call

  1. On the Data Services screen, click the CREATE DATA SERVICES button located at the upper-right corner.
    The system displays the types of data services.
  2. Click HTTP GET.
    The following screen appears.
  3. Provide the following details:
  • Service Name: Name of the data service.
  • Service Description: Description of the data service.
  • End-point URL: Enter the endpoint URL.
  • Response Processing: Create the syntax of the response body.
  • Http Headers: Add additional parameters in the HTTP header request and click Add New Header. It should be in key-value pair.
    Example:
    • HTTP Header Name is apikey
    • HTTP Header Value is 8391988a-4f22-4510-b0d7-9232df8
  1. Click Save.
1774

The following is a sample HTTP GET Data Service.

1778

Creating Trusted Agent Query

  1. On the Data Services screen, click the CREATE DATA SERVICES button located at the upper-right corner.
    The system displays the types of data services.
  2. Click Trusted Agent.
    The following screen appears.
  3. Provide the following details:
  • Service Name: Name of the data service.
  • Service Description: Description of the data service.
  • Object Query: Name of the object to query.
  • Query: URL query string to query the object.
  1. Click Save.
1766

Creating Custom Service

  1. On the Data Services screen, click the CREATE DATA SERVICES button located at the upper-right corner.
    The system displays the types of data services.
  2. Click Custom Service.
    The following screen appears.
  3. Provide the following details:
  • Service Name: Name of the data service.
  • Service Description: Description of the data service.
  • Script Parameters (Optional): A comma-separated list of parameter names.
  • Script: Use the editor to write the script.
  1. Click Save.
1771

The following is a sample of Custom Data Service.

1772

Creating CSV Data Store

Use this data service to retrieve data from a CSV file.

  1. On the Data Services screen, click the e CREATE DATA SERVICES button located at the upper-right corner.
    The system displays the types of data services.
  2. Click CSV DataStore.
    The following screen appears.
  3. Provide the following details:
  • Service Name: Name of the data service.
  • Service Description: Description of the data service.
  • URL for CSV file: Location of the .csv file. For example, https://{domain}/z1/public/sample.csv.
  • Match criteria: Extracts values from the CSV where the column matches the given criteria. For example, city=${cityName}.
  • Field separator: Character used as a separator for values in each line. For example, ",".
  • File refresh interval: Time interval in minutes at which the CSV file is refreshed.
  1. Click Save.
1770