Insert KPI's records (Upload CSV)
POST
/api/initiatives/{{product_external_key}}/kpi/{{kpi_external_key}}/insert-kpi-recordsThis API endpoint allows users to insert Key Performance Indicators (KPIs) by uploading a CSV file. This request supports only the insertion of new KPI records via the CSV file upload.
Request
Follow these steps to find your product_external_key:
Visit https://app.shorterloop.com/ACME/product/MGMT/dashboard.
The product_external_key is the segment in the URL, in this example, MGMT.
Use this product_external_key in the product_external_key Query Params when making the API request.
Follow these steps to find your kpi_external_key:
Open the dialog box for the desired metric.
Locate the field labeled "KPI Unique Key."
Click the copy button next to the "KPI Unique Key" field to copy the key.
Use this key as the value for the kpi_external_key query parameter when making the API request.
Upload CSV for JSON file to insert or update data.
Request samples
Responses
{
"success": true,
"message": "Records inserted successfully. 2 out of 9 KPI records were not inserted due to incorrect entries in the provided data.",
"data": {
"id": 1162,
"title": "Matrics sample",
"externalKey": "KPI-15",
"benchmark": "334455.00",
"visualization": true,
"benchmarkUnit": "INR",
"benchmarkType": "MORE",
"initiativeId": 1139,
"dueDate": "2024-06-29T18:30:00.000Z",
"dashboardVisualization": true,
"statement": "4455",
"createdAt": "2024-05-16T06:48:10.000Z",
"kpi_revisions": [
{
"id": 1008,
"createdAt": "2024-05-16T06:53:19.000Z",
"value": "148.00"
},
{
"id": 1010,
"createdAt": "2024-05-16T06:53:19.000Z",
"value": "33.99"
},
{
"id": 1011,
"createdAt": "2024-05-16T06:53:19.000Z",
"value": "14.00"
},
{
"id": 1013,
"createdAt": "2024-05-16T06:53:19.000Z",
"value": "18.00"
},
{
"id": 1002,
"createdAt": "2024-05-16T06:49:36.000Z",
"value": "12.00"
},
{
"id": 1003,
"createdAt": "2024-05-16T06:49:36.000Z",
"value": "14.00"
},
{
"id": 1004,
"createdAt": "2024-05-16T06:49:36.000Z",
"value": "130.00"
},
{
"id": 1006,
"createdAt": "2024-05-16T06:49:36.000Z",
"value": "33.99"
},
{
"id": 1007,
"createdAt": "2024-05-16T06:49:36.000Z",
"value": "22.89"
},
{
"id": 999,
"createdAt": "2024-05-16T06:49:12.000Z",
"value": "148.00"
},
{
"id": 1001,
"createdAt": "2024-05-16T06:49:12.000Z",
"value": "33.99"
},
{
"id": 996,
"createdAt": "2024-05-16T06:48:52.000Z",
"value": "130.00"
},
{
"id": 998,
"createdAt": "2024-05-16T06:48:52.000Z",
"value": "33.99"
},
{
"id": 995,
"createdAt": "2024-05-16T06:48:10.000Z",
"value": "4455.00"
},
{
"id": 997,
"createdAt": "2024-05-11T07:38:05.000Z",
"value": "223.09"
},
{
"id": 1014,
"createdAt": "2024-04-04T07:38:05.000Z",
"value": "23.90"
},
{
"id": 1012,
"createdAt": "2024-03-10T07:38:05.000Z",
"value": "223.09"
},
{
"id": 1000,
"createdAt": "2024-03-01T07:38:05.000Z",
"value": "223.09"
},
{
"id": 1005,
"createdAt": "2024-03-01T07:38:05.000Z",
"value": "223.09"
},
{
"id": 1009,
"createdAt": "2024-02-21T07:38:05.000Z",
"value": "22.00"
}
]
}
}