×

Battery charge by VIN

This API retrieves battery charge information for a vehicle based on its VIN.
It works only for vehicles that meet the following conditions:
— the VIN field is filled in the vehicle card
— a battery charge sensor is connected
You can specify multiple VINs in a single request. The response will include battery data for all specified vehicles.

How to get data

Request address

To get the data, use the address:  https://<server_address>/api/VTB/api_vtb.php

Request method

POST
The API requires two steps:
1. Authorization — obtain a token to access data
2. Data Request — use the token to retrieve battery information by VIN
 

1. Authorization

Before requesting data, you must authenticate.
Request Body:
{
  "login": "your_login",
  "password": "your_password",
  "cmd": "auth"
}
Response
{
  "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
The response contains a token, which is a long unique string. This token is required for all subsequent API requests. Without it, the API will not return battery data.
 

2. Retrieving battery sensor data

After obtaining the token, you can request battery information.
Request parameters:
  • Number — list of VINs for vehicles you want to query
  • DateFrom — start date and time (ISO 8601 format)
  • DateTo — end date and time (ISO 8601 format)
  • cmd=vehicle — API command to request vehicle data
Request headers:
  • Authorization: Bearer <token>— include the token obtained during authorization
  • Content-Type: application/json— specify that the request body is JSON
Request body example:
{
  "Number": ["VIN_of_vehicle"],
  "DateFrom": "2023-12-03T00:00:00",
  "DateTo": "2023-12-12T00:00:00",
  "cmd": "vehicle"
}
Response
[
  {
    "Number": "456789123",
    "ApplicationNumber": null,
    "CurrentStatus": "ACTIVE",
    "CloseDateTime": "",
    "LastSyncDate": "2024-08-28 15:42:45",
    "AlarmDateTime": "2024-08-28 15:42:45",
    "Latitude": "55.578352",
    "Longitude": "38.125267",
    "BatteryCharge": "full charge",
    "LocationLinesID": "",
    "FullAddress": "ulitsa Garnaeva, Market, Zhukovsky, Moscow Region, Russia",
    "Country": "Russia",
    "Region": "Moscow Region",
    "Town": "Zhukovsky",
    "Street": "ulitsa Garnaeva",
    "House": null,
    "numberRegion": 10
  }
]
In response to the API request, the following is returned:
  • Number — VIN of the vehicle
  • CurrentStatus — current status of the vehicle
  • LastSyncDate — date of last synchronization
  • BatteryCharge — battery charge level
  • FullAddress, Country, Region, Town, Street — location of the vehicle
  • Latitude, Longitude — coordinates of the vehicle