Appearance
Introduction
IMPORTANT
You must run KvalCAM at least once after first installation to generate the config and settings files required to complete the following steps.
Additionally, the main KvalCAM application must be running in order to communicate with its API.
Enabling the API
You may enable the KvalCAM REST Web API by editing the C:\Kval\KvalMachineData\ModuleData\KvalCAM\KvalCAMSettings.xml
file and set the EnableWebAPIHost
element to true
.
To change the port the host listens on change the WebAPIHostPort
element to the desired port number:
xml
<KvalCAMSettings>
<KvalCAMDBSource>SqliteDB</KvalCAMDBSource>
<ConnectionString>Data Source=127.0.0.1,1433;Initial Catalog=KvalCamDB;User ID=kval1;Password=kval1;Network Library=DBMSSOCN</ConnectionString>
<EnableWebAPIHost>true</EnableWebAPIHost>
<WebAPIHostPort>9707</WebAPIHostPort>
<WebHostMinLogLevel>Trace</WebHostMinLogLevel>
</KvalCAMSettings>
When KvalCAM first runs with the Web API enabled windows will prompt the user to allow it to listen on the port, click allow.
Interactive Docs
Once KvalCAM is running and the WebAPI is enabled you can connect to it locally in a browser by visiting http://localhost:{port}/rest/api/docs
(default port is 9707
if not changed in the KvalCAMSettings.xml
file). The docs page is generated by the server and updated to automatically to stay in sync with the KvalCAM version that is running.
From the docs page you may view all the REST API commands available, and try any of them interactively using the browser.