Real-World KPI Examples

This chapter provides real-world examples for configuring KPIs using the Generic Web Service connector. These KPIs are designed to extract and transform single values from REST API responses, such as current weather conditions.

Connector Settings

Ensure the following fields are configured in the Connector Settings for the examples below:

Setting

Value

API URL

https://api.weatherapi.com/

Authentication

None

API Key

secret-key

This example assumes that the target API does not require authentication beyond a static API key.

These settings allow the connector to reach the correct API endpoint and authorize the request using a predefined key.

KPI Example: Current Temperature in Celsius

This KPI retrieves the current temperature in Celsius for London.

{
  "request": {
    "methodType": "GET",
    "query": "/v1/current.json?key={$API_KEY}&q=London&aqi=no"
  },
  "data": {
    "path": "current.temp_c",
    "value": {
      "inputType": "number",
      "outputFormat": "N0"
    }
  }
}