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.configfile, and in thedatabaseServerssection, 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
NameThis can be an arbitrary name, such as
SuperServer, and is intended to identify and distinguish the database server.AddressThis 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).TypeThis 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
sqlserver2014orsqlserver2014unicode.UsernameThis parameter must be added manually and the value must be the Microsoft SQL Server user.
PasswordThis parameter must be added manually and the value must be the password of the Microsoft SQL Server user.
DiskPathThis is the location where databases are created and stored.
LogPathThis is the location where the log file is created and stored.
TimeoutSecondsThis 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.configfile.Set the
BlacklistServicesvalue to the connection of the Redis Server.The
BlacklistServicesvalue 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
SystemCallsSecretKeyvalue to match theAPI_KEYvalue in the tenant services configuration file.Set the
MessageSecretKeyvalue to match theJWT_KEYvalue in the tenant services configuration file.Set the
SchedMessageSecretKeyvalue to match theSCHED_KEYvalue in the tenant services configuration file.Set the
TenantSecretKeyvalue to match theTENANT_KEYvalue 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\RestAPIOpen the
RESTAPI.appSettings.configfile.In the
Saved Import File Settingssection, configure the following parameters:Parameter
Description
ImportFileDirectoryThis is the location of the network or shared drive where the REST API saves the import files.
ImportFileUserNameThe user name with access to the network or shared drive where the import files are saved.
ImportFileDomainNameThe domain name of network or shared drive where the import files are saved.
ImportFilePasswordThe 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
IsSingleImportDirectoryvalue 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\RestAPIOpen the
RESTAPI.appSettings.configfile.Change the value of
DisableDataFolderOnPremfrom 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.configfile.Find the
TenantServiceskey in the file and changelocalhostto 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
IsTenantServicesRunningkey and change the value from 0 to 1.It will look like this when you're done:
<add key="IsTenantServicesRunning" value="1" />
Find the
Hostkey 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
OnPremkey 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.