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.
Navigate to the location where the REST API is installed.
By default, it is installed at
C:\Program Files (x86)\Incentives\RestAPI
.Open the
RESTAPI.dbServers.config
file, and in thedatabaseServers
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
orsqlserver2014unicode
.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.
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.
Navigate to the location where the REST API is installed.
By default it is installed here:
C:\Program Files (x86)\Incentives\RestAPI
.Open the
RESTAPI.appSettings.config
file.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.Set the
SystemCallsSecretKey
value to match theAPI_KEY
value in the tenant services configuration file.Set the
MessageSecretKey
value to match theJWT
_KEY
value in the tenant services configuration file.Set the
SchedMessageSecretKey
value to match theSCHED
_KEY
value in the tenant services configuration file.Set the
TenantSecretKey
value to match theTENANT_KEY
value in the tenant services configuration file.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.
Navigate to the location where the REST API is installed.
By default it is installed here:
C:\Program Files (x86)\Incentives\RestAPI
Open the
RESTAPI.appSettings.config
file.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.
By default, saved imports are saved to a single folder. To change this setting to allow multiple saved import folders, change the
IsSingleImportDirectory
value toFALSE
.
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:
Navigate to the location where the REST API is installed.
By default it is installed here:
C:\Program Files (x86)\Incentives\RestAPI
Open the
RESTAPI.appSettings.config
file.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.
Navigate to the location where the REST API is installed.
Open the
RESTAPI.appSettings.config
file.Find the
TenantServices
key in the file and changelocalhost
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" />
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" />
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" />
Find the
OnPrem
key and change the value totrue
.It will look like this when you're done:
<add key="OnPrem" value="true" />
Save the file.
To continue with the installation, please see the Setting up HTTPS for the REST API section.