To configure WebAPI.config file manually, you need to follow these three sub process:
-
Configure Database details
-
Configure Authorization details
-
API logs directory in Nlog config file
Configure Database details
-
Navigate to the folder: <installed path>\Web\API\web.config.
-
In connectionStrings, Data Source should point to the required database alias (TNS) and provide M_WEBAPI user's password.
For example: <add name="SmatSiteDataContext" connectionString="DATA SOURCE=IQA10UFDBAPI.world;USER ID=m_webapi;PASSWORD=M_WEBAPI;Connection Timeout=30;" providerName="Oracle.DataAccess.Client" /></connectionStrings>.
Configure Authorization details
-
Navigate to the folder: <installed path>\Web\API\web.config.
-
Update the web.config file with the following authorization details:
If you are a new user then first configure authorization details/server (for more, view Configure authorization servers for SMAT Web API).
Parameter Name
Mandatory/Optional
baseURI
Mandatory
issuerUri
Mandatory
Resource id
Mandatory
Secret
Optional
AudienceId
Optional
Required scopes
Optional
For example:
<services baseUri="https://in-smatapidb.ingrnet.com:8443/SmartMaterialsWebAPI/API/">
<service prefix="SMAT/V1" id="7307E1EC-72B3-4523-944D-EFFDFB8E25F1" secret="" instance="" audience="" />
</services>
<security>
<oauth issuer="https://samqa.ingrnet.com/sam/oauth/" requiredScopes="" />
API logs directory in Nlog config file
-
Navigate to the folder: <installed path>\Web\API\Nlog.config.
-
In the config file, update the directory path in Nlog.config for API logs.
For example, <target xsi:type=:"File" name=:TraceFile" filename="E:\oradata\SDBFT\utl/${shortdate}-NLogTrace,log".