Skip to main content

Manually configuring the REST API

After installing the REST API, you may configure the different settings to meet your needs.

Configuring database server settings for the REST API

The REST API configuration file must be edited so the REST API can communicate with the Incentives database server.

  1. Navigate to the location where the REST API is installed.

    By default, it is installed at C:\Program Files (x86)\Incentives\RestAPI.

  2. Open the RESTAPI.dbServers.config file, and in the databaseServers section, configure these parameters:

    Tip

    Most of the parameters should match the ones in defaults.json (see: Configuring access to the SQL server for tenant services. You can use that file as a reference and copy and paste those parameters.

    When writing file paths, use one backslash \ for REST API configuration and two backslashes \\ for tenant services configuration.

    Parameter

    Description

    Name

    This can be an arbitrary name, such as SuperServer, and is intended to identify and distinguish the database server.

    Address

    This address points to the location of the database. Use the following format for the address: SERVER_NAME\\INSTANCE_NAME. If SQL Server is not using the default port 1433, you must add the port number to the server address field (for example, SERVER_NAME\\INSTANCE_NAME, PORT_NUMBER).

    Type

    This is the type of database that you are using.

    To use SQL Server 2016, all configurations must be done as if using SQL Server 2014. For example, if the database you are using is SQL Server 2016, then type sqlserver2014 or sqlserver2014unicode.

    Username

    This parameter must be added manually and the value must be the Microsoft SQL Server user.

    Password

    This parameter must be added manually and the value must be the password of the Microsoft SQL Server user.

    DiskPath

    This is the location where databases are created and stored.

    LogPath

    This is the location where the log file is created and stored.

    TimeoutSeconds

    This is the number of seconds before a timeout occurs. The database timeout default is 90 seconds. This is the minimum amount of time that clients must wait before the application can warn of a network or server issue. For models with long calculation times, you can increase this time to avoid a database timeout during calculation.

  3. Save the file.

Configuring tenant services settings for the REST API

After you configure database access for the REST API, you will configure tenant services settings.

  1. Navigate to the location where the REST API is installed.

    By default it is installed here: C:\Program Files (x86)\Incentives\RestAPI.

  2. Open the RESTAPI.appSettings.config file.

  3. Set the BlacklistServices value to the connection of the Redis Server.

    The BlacklistServices value is used to track administrator user log outs. If the value is not configured correctly, then when administrator users log out, the JWT associated with their sessions can continue to be used to make API calls.

  4. Set the SystemCallsSecretKey value to match the API_KEY value in the tenant services configuration file.

  5. Set the MessageSecretKey value to match the JWT_KEY value in the tenant services configuration file.

  6. Set the SchedMessageSecretKey value to match the SCHED_KEY value in the tenant services configuration file.

  7. Set the TenantSecretKey value to match the TENANT_KEY value in the tenant services configuration file.

  8. Save the file.

Configuring saved import settings for the REST API

After you configure database access for the REST API, you must configure the saved import file settings manually before any imports can be saved by the Incentives REST API.

  1. Navigate to the location where the REST API is installed.

    By default it is installed here: C:\Program Files (x86)\Incentives\RestAPI

  2. Open the RESTAPI.appSettings.config file.

  3. In the Saved Import File Settings section, configure the following parameters:

    Parameter

    Description

    ImportFileDirectory

    This is the location of the network or shared drive where the REST API saves the import files.

    ImportFileUserName

    The user name with access to the network or shared drive where the import files are saved.

    ImportFileDomainName

    The domain name of network or shared drive where the import files are saved.

    ImportFilePassword

    The password associated with the user name with access to the network or shared drive where the import files are saved.

  4. By default, saved imports are saved to a single folder. To change this setting to allow multiple saved import folders, change the IsSingleImportDirectory value to FALSE.

Removing Data folder in ImportFileDirectory

Incentives creates a Data folder in the ImportFileDirectory folder which redirects all your inbound files to store in the new Data folder. You can remove the Data folder and access your files directly from the ImportFileDirectory folder by following these steps:

  1. Navigate to the location where the REST API is installed.

    By default it is installed here: C:\Program Files (x86)\Incentives\RestAPI

  2. Open the RESTAPI.appSettings.config file.

  3. Change the value of DisableDataFolderOnPrem from false to true:

    <add key="DisableDataFolderOnPrem" value="true"/>

Configuring additional settings for the REST API

After you configure database access for the REST API, there are a few more settings you must configure.

  1. Navigate to the location where the REST API is installed.

  2. Open the RESTAPI.appSettings.config file.

  3. Find the TenantServices key in the file and change localhost to the hostname of the server where tenant services is installed.

    It will look like this when you're done:

    <add key="TenantServices" value="http://hostname:9101/services" />
  4. Find the IsTenantServicesRunning key and change the value from 0 to 1.

    It will look like this when you're done:

    <add key="IsTenantServicesRunning" value="1" />
  5. Find the Host key and change the value to the location of tenant services.

    It will look like this when you're done:

    <add key="Host" value="http://hostname:8080" />
  6. Find the OnPrem key and change the value to true.

    It will look like this when you're done:

    <add key="OnPrem" value="true" />
  7. Save the file.

To continue with the installation, please see the Setting up HTTPS for the REST API section.