These are the KPIs that are associated with the KPI category. And allow you to easily list and manage KPIs within a specific category.
The object has the following properties:
| Name | Type | Read Only | Mandatory | Max Len. | Notes |
|---|---|---|---|---|---|
| id | integer | yes | no | Automatically generated for the KPI | |
| category_id | integer | yes | no | The id of the category the KPI is in | |
| image_id | integer | no | yes | The id of the icon to assign to the KPI | |
| format_id | integer | no | yes | The id of the format of measure to assign to the KPI | |
| frequency | character | no | yes | 1 | The id of the frequency of data entry for the KPI. This field is case sensitive and must be uppercase. |
| name | string | no | yes | 100 | The name of the KPI |
| description | string | no | no | 150 | The description of the KPI |
| target | decimal | no | no | The default target value for the KPI. If left blank or null the KPI will not have a target | |
| direction | character | no | yes | 1 | The value direction is case sensitive and can only be U(p), D(own) and N(one) |
| aggregate | string | no | yes | 3 | The aggregate function determines how the KPI is calculated and can be either AVG (Average) or SUM (Total Sum). |
| disable | boolean | no | yes | Active KPIs can have date entered against them otherwise they are display only KPIs | |
| calculated | boolean | yes | no | Calculated KPIs cannot be amended via the API and must be added / amended in the interface |
{
"id": 111,
"category_id": 222,
"icon_id": 1,
"unit_id": 11,
"frequency_id": "M",
"name": "Number of Sales",
"description": "Kpi description",
"target_default": null,
"value_direction": "N",
"aggregate_function": "SUM",
"is_active": true,
"calculated": false,
}
<KPI xmlns="http://schemas.datacontract.org/2004/07/Waytobi.App.Api.Models"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<id>111</id>
<category_id>222</category_id>
<icon_id>1</icon_id>
<unit_id>11</unit_id>
<frequency_id>M</frequency_id>
<name>Number of Sales</name>
<description>Kpi description</description>
<target_default>null</target_default>
<value_direction>N</value_direction>
<aggregate_function>SUM</aggregate_function>
<is_active>true</is_active>
<calculated>false</is_calculated>
</KPI>
GET /api/kpicategories/{category_id}/kpis
curl https://app.waytobi.com/api/kpicategories/{category_id}/kpis
-v -u {token}
Status: 200 OK
[
{
"id": 111,
"category_id": 222,
"icon_id": 1,
"unit_id": 11,
"frequency_id": "M",
"name": "Number of Sales",
"description": "Kpi description",
"target_default": null,
"value_direction": "N",
"aggregate_function": "SUM",
"is_active": true,
"calculated": false,
},
{
"id": 112,
"category_id": 223,
"icon_id": 4,
"unit_id": 2,
"frequency_id": "D",
"name": "Calls",
"description": "Calls kpi description",
"target_default": null,
"value_direction": "N",
"aggregate_function": "SUM",
"is_active": true,
"calculated": false,
}
]
GET /api/kpicategories/{category_id}/kpis/{id}
curl https://app.waytobi.com/api/kpicategories/{category_id}/kpis/{id}
-v -u {token}
Status: 200 OK
{
"id": 111,
"category_id": 222,
"icon_id": 1,
"unit_id": 11,
"frequency_id": "M",
"name": "Number of Sales",
"description": "Kpi description",
"target_default": null,
"value_direction": "N",
"aggregate_function": "SUM",
"is_active": true,
"calculated": false,
}
POST /api/kpicategories/{category_id}/kpis
curl https://app.waytobi.com/api/kpicategories/{category_id}/kpis
-H "Content-Type: application/json"
-d '{"icon_id":1, "unit_id":11, "frequency_id":"M", "name":"Number of Sales",
"description":"New description", "target_default":100, "value_direction":"N",
"is_active":true}'
-v -u {token} -X POST
Status: 201 Created
Location: https://app.waytobi.com/api/kpicategories/{category_id}/kpis/{id}
{
"id": 111,
"category_id": 222,
"icon_id": 1,
"unit_id": 11,
"frequency_id": "M",
"name": "Number of Sales",
"description": "New description",
"target_default": 100,
"value_direction": "N",
"aggregate_function": "SUM",
"is_active": true,
"calculated": false,
}
PUT /api/kpicategories/{category_id}/kpis/{id}
curl https://app.waytobi.com/api/kpicategories/{category_id}/kpis/{id}
-H "Content-Type: application/json"
-d '{"icon_id":1, "unit_id":11, "frequency_id":"M", "name":"Number of Sales",
"description":"New description", "target_default":100, "value_direction":"N",
"is_active":true}'
-v -u {token} -X PUT
Status: 200 OK
{
"id": 111,
"category_id": 222,
"icon_id": 1,
"unit_id": 11,
"frequency_id": "M",
"name": "Number of Sales",
"description": "New description",
"target_default": 100,
"value_direction": "N",
"aggregate_function": "SUM",
"is_active": true,
"calculated": false,
}
DELETE /api/kpicategories/{category_id}/kpis/{id}
curl https://app.waytobi.com/api/kpicategories/{category_id}/kpis/{id}
-v -u {token}
Status: 200 OK
Looking for anything specific article which resides in general queries? Just browse the various relevant folders and categories and then you will find the desired article.
Contact Us