/api/reports/views/:id/kpi

This method returns data and metadata of specified KPI view.

Resource Information

Request Parameters

Parameters

Detail

Example

id

ID of the KPI view. This ID is a part of the /api/reports/:id response.

1234

filter

(Optional) Filter used in the KPI with following structure:

Name
Description
drilldown

Drilldown defined with attribute code and following structure:

Name
Description
opFilter operation type - please see list of supported values.
value/values(Optional) Depends on selected "op". Contains value or values for filter.
countOp

(Optional) Used with COUNT operation. Specifies the second operation used together with count.

Supported values: EQ, NEQ, GT, GTE, LT, LTE


 

{
   "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"
      }
   }
}

dateTimeDefinition

(Optional) Date and time definition used in the KPI with following structure:

NameDescription
dateInterval

(Optional) Date interval to filter values. Has following structure:

Name
Description
aggregationTypeDate interval period - please see list of supported values.
interval

Interval definition with following structure:

Name
Description
typeInterval type - please see list of supported values.
fromInterval start value - please see Setting Date Interval
toInterval end value - please see Setting Date Interval
timeInterval

(Optional) Time interval to filter values. Has following structure:

Name
Description
aggregationTypeTime interval period - please see list of supported values.
interval

Interval definition with following structure:

Name
Description
typeInterval type - please see list of supported values.
fromInterval start value - please see Setting Date Interval
toInterval end value - please see Setting Date Interval


 

{
   "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:

NameDescription
captionCaption of KPI
numberValueNumber value (with units or special characters) represented as String
percentPercent value
sizeSize of KPI - please see list of supported values.
symbol

Conditional formatting symbol type - please see list of supported values.

symbolValueConditional formatting symbol value - please see list of supported values.
styleCSS 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); "
    },
  ]
}
  • No labels