Health Check
- Last UpdatedJun 24, 2025
- 1 minute read
- Engineering
- Integration Service 4.0
- Integrators
You can use the HealthCheckClientFactory to verify the availability of the Data API. The following code snippet can be use to check the health of the DataAPI.
The value of the variable host should be the URL where the DataAPI is hosted. To check the health of ConfigAPI pass the value of ConfigAPI URL as host.
var baseDataClient = HealthCheckHttpClientFactory.CreateHealthCheckHttpClient(client, host);
var apiHealthCheck = await baseDataClient.HealthCheckAPI(dataAPIHCUrl);
StringBuilder sb = new StringBuilder();
if (apiHealthCheck == System.Net.HttpStatusCode.OK)
{
sb.AppendLine($"The DATA API is up and running.");
}
else
{
sb.AppendLine($"The DATA API is down and the status code is {apiHealthCheck}.");
exitApplication = true;
}
MessageBox.Show(sb.ToString());
if (exitApplication)
{
return;
}