/api/reports/views/:id/kpi
This method returns data and metadata of specified KPI view.
Resource Information
Resource URL | |
HTTP Method |
|
Request Parameters
Parameters | Detail | Example | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ID of the KPI view. This ID is a part of the | 1234 | ||||||||||||||||||||||||||||||||||
| (Optional) Filter used in the KPI with following structure:
| { "drilldown": { "L_COUNTRY_OR_AREA": { "op": "EQ", "value": "Slovakia" }, "L_TYPE": { "op": "IN", "values": [ "Type 1", "Type 2", "Type 3" ] }, "L_DATE": { "op": "NOT_NULL" }, "L_PRODUCT":{ "op":"COUNT", "countOp":"LTE", "value":"816" } } } | ||||||||||||||||||||||||||||||||||
| (Optional) Date and time definition used in the KPI with following structure:
| { "dateInterval": { "interval": { "from": "actualYear-1y", "to": "actualYear-1d", "type": "custom" }, "aggregationType": "DAY" }, "timeInterval": { "interval": { "from":{"hour":"14","minute":"15","second":"16"}, "to":{"hour":"20","minute":"0","second":"0"}, "type": "absolute" }, "aggregationType": "SECOND" } } |
Response Structure
{ "values": [ ] }
JSON response contains array "values" containing multiple KPI objects with following definition:
Name | Description |
---|---|
caption | Caption of KPI |
numberValue | Number value (with units or special characters) represented as String |
percent | Percent value |
size | Size of KPI - please see list of supported values. |
symbol | Conditional formatting symbol type - please see list of supported values. |
symbolValue | Conditional formatting symbol value - please see list of supported values. |
style | CSS style |
Sample request/response
Using curl
:
curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" https://service.belladati.com/api/reports/views/88738/kpi
The JSON format response:
{ "values": [ { "caption": "Success Rate", "numberValue": "86 %" }, { "caption" : "Investments", "numberValue" : "4565136.4 USD", "percent" : 10.912883499999996, "size" : "large", "symbol" : "ARROW_DOWN", "symbolValue" : "↓", "style" : " color:rgb(54, 132, 44); background-color:rgb(215, 255, 151); " }, ] }