gear-codeGet metric data API

Uses the POST method

Use this API to retrieve the plan and actual values of a metric with dimensions and time periods using the POST method.

circle-info

The reason for using 'POST' instead of 'GET' is to simplify complex dimension filtering and to accommodate the limited query parameter length.

Path: https://{your_subdomain}.drivetrain.ai/drive/api/v1/public/metrics/{metricName}/data

Path Parameter: metricName: The name of the metric from which you want to retrieve the data. Please note that the metricName here refers to the identifier or Backend Name of the metric, not the displayName.

Request Body Parameters

startDate: The date from which we want to fetch the metric data. (OPTIONAL)

endDate: The date until which we want to fetch the metric data. (OPTIONAL)

metricValueType: metricValueType is an ENUM and its value can be [CURRENT, ACTUAL]. CURRENT is for current or planned values, and ACTUAL is for actual values. (OPTIONAL)

  • startDate and endDate parameters are optional. If you don't provide them, it will send the data for the entire planning period by default. Please note that endDate becomes mandatory if startDate is provided, and vice versa.

  • metricValueType is an optional parameter. If you don't provide it, the API will send both CURRENT and ACTUAL values.

  • pivot: the pivot argument that can be used to get the required dimension values data. Using pivot, users can also filter dimensions. (OPTIONAL)

    • dimensions: root key for dimensions.

      • rows: the dimension names which are needed in response.

      • filters: filters on the dimensions.

Structure of pivot

"pivot": {
           "dimensions": {
               "rows":["Region", "Country"],
                "filters":{
                    "Region":["NAMER", "JAPAC"],
                    "Country":["US"]
                }
            }
        }

Headers: apikey (MANDATORY)

Curl command example

Response structure

data: root key

  • name: The identifier of the metric.

  • displayName: The Display Name of the metric in Drivetrain.

  • current: contains the planned or current values for the metric for a given time 't'. actual: contains the actual values for the metric for a given time 't'.

  • dimensions: contains {dimension name: dimension value} pair for every value of the metric for given time 't'. value: The current or actual value for a given time 't'.

  • t: the date to which the value belongs.

  • period: The time period to which the value belongs. For e.g, Quarter (Q1, Q2, Q3, etc), Half-Yearly (H1, H2), Yearly (Y).

Sample Response

Last updated

Was this helpful?