Getting a single KPI instance
This endpoint returns a JSON object representing a KPI instance.
Authentication phase
Before using the endpoint, you must run the authentication phase (→ Login).
After the authentication, a session opens and a valid session token persists until:
- The end of the session time-out, that is set through the parameter sessionTimeout (→ OptimaWSI configuration > OptimaAuth section).
- An explicit Logout call (→ Logout).

Request
GET
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/optima-kpi/kpi/api/instance/<instance_id>
Request resource
Not applicable.
Request parameters
Parameter | Required | Description |
---|---|---|
instance_id |
YES |
Integer type. It contains the identifier of an existing KPI instance. |
Request content-type
Not applicable.
Request body (payload)
Not applicable.

Response status
HTTP status | Description |
---|---|
200 OK |
The KPI instance is described by the JSON object in the output. |
404 Not found |
The output message is formatted as shown: <Not Found>: <KPI instance <instance_id> does not exist.> |
Response content-type
application/JSON
Response output
As output you get a JSON object containing all the elements of the KPI instance specified by <instance_id>.

Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/optima-kpi/kpi/api/instance/1
Response status
HTTP status | Description |
---|---|
200 OK |
The processing request has been accepted. |
Response output
{
"id": 1
"templateId": 11,
"name": "Test KPI instance",
"description": "Number of Vehicles on the Network",
"durablePoints": false,
"editable": true,
"enabled": true,
"category": "Category TEST",
"tags": "asa",
"range": {
"min": 0,
"max": 60
},
"pointDuration": 3000,
"schedule": 60,
"computationTypeCode":"TRIGGERED",
"dynamicAttributes": [
{
"code": "fore",
"value": "1800"
},
{
"code": "onlyQueue",
"value": "nveh"
},
{
"code": "shortTermForecastKpi",
"value": "true"
}
],
"affectedLinks":[
{
"tail":3119676,
"idno":3503373,
"order":1
},
{
"tail":2788659,
"idno":3503359,
"order":2
},
{
"tail":2789655,
"idno":3503399,
"order":3
{
"tail":2789877,
"idno":3513001,
"order":4
}
]
}