POST

Загрузка показателей

https://kpidata.ru/api/metrics.php
This endpoint allows users to submit metric data to the KPI Data API. The request requires authentication via email and password, and includes an array of metrics to be recorded.

Request Body

The request body should be in JSON format and includes the following parameters:

- email (string): The email address associated with the user account.
- password (string): The password for the user account.
- metrics (array): An array of metric objects, each containing:
- name (string): The name of the metric.
- value (string): The numerical value of the metric.
- unit (string): The unit of measurement for the metric.
- description (string): A brief description of the metric.
- updated_at (string): A timestamp indicating when the metric was last updated.

Response

Upon a successful request, the API will return a JSON response with the following fields:
- success (boolean): Indicates whether the request was successful.
- inserted (integer): The number of metrics successfully inserted.

Example

Request:

JSON
{
"email": "kpi@kpidata.ru",
"password": "qqfSSuD9ky",
"metrics": [
{
"name": "Магазин на Кирова (ООО Ромашка ...",
"value": "28426.00",
"unit": "руб.",
"description": "Оперативные продажи по складу ...",
"updated_at": "2025-06-12 10:00:00"
}
]
}

Response:

JSON
{
"success": true,
"inserted": 0
}