Kilometers traveled
Description
GET [API_URL]/rpt_kilometers
Obtain the entry and exit of the devices in geofences.
Call limit: 1 request every 15 seconds
Cache live time: 300 seconds
Headers
Name
Value
Content-Type
application/json
tenant
logicsat
Authorization
Bearer eyJhbGciOiJIUzI1NiIsInR...
Body
Name
Type
Description
pagination
IPagination
devices
string[]
devices name
perperson
bool
group by person
perday
bool
group by day
subtotals
bool
add subtotal per device and total per device
groupbygeo
string
group by geographical level (state, city, neighbourhood) see ENUM GEOGRAPHICAL_LEVEL
startdate*
datetime
from (YYYY-MM-DDTHH:mm:ss)
enddate*
datetime
to (YYYY-MM-DDTHH:mm:ss)
export interface IApiDev_RptGeofenceFilter {
pagination?: IPagination;
devices?: string[];
perday?: boolean;
perperson?: boolean;
subtotals?: boolean;
groupbygeo?: string;
startdate: string;
enddate: string;
}export enum GEOGRAPHICAL_LEVEL {
state = 'state',
city = 'city',
neighbourhood = 'neighbourhood'
}Response
export interface IApiDev_RptKilometers {
full_count?: number;
device_name?: string;
person_name?: string;
device_group?: string;
state?: string;
city?: string;
neighbourhood?: string;
datetime?: string;
kms?: number;
temperature?: number;
gas?: number;
cost?: number;
co2?: number;
} [
{
full_count: '5',
device_name: 'Renault Clio IV',
person_name: '',
device_group: 'ML',
state: 'Montevideo',
city: 'Montevideo',
neighbourhood: 'Bolivar',
datetime: '2024-07-08',
kms: 0.34,
gas: 0.02,
temperature: 0,
cost: 1.41,
co2: 140.71
},
{
full_count: '5',
device_name: 'Renault Clio IV',
person_name: '',
device_group: 'ML',
state: 'Montevideo',
city: 'Montevideo',
neighbourhood: 'Castro Castellano',
datetime: '2024-07-08',
kms: 1.05,
gas: 0.06,
temperature: 0,
cost: 4.37,
co2: 136.69
},
{
full_count: '5',
device_name: 'Renault Clio IV',
person_name: '',
device_group: 'ML',
state: 'Montevideo',
city: 'Montevideo',
neighbourhood: 'Cerrito',
datetime: '2024-07-08',
kms: 0.21,
gas: 0.01,
temperature: 0,
cost: 0.87,
co2: 113.9
},
{
full_count: '5',
device_name: 'Renault Clio IV',
person_name: '',
device_group: 'ML',
state: 'Montevideo',
city: 'Montevideo',
neighbourhood: 'Ituzaingó',
datetime: '2024-07-08',
kms: 0.14,
gas: 0.01,
temperature: 0,
cost: 0.58,
co2: 170.86
},
{
full_count: '5',
device_name: 'Renault Clio IV',
person_name: '',
device_group: 'ML',
state: 'Montevideo',
city: 'Montevideo',
neighbourhood: 'Jacinto Vera',
datetime: '2024-07-08',
kms: 1.86,
gas: 0.1,
temperature: 0,
cost: 7.74,
co2: 128.6
},
{
full_count: null,
device_name: 'Renault Clio IV (subtotal)',
person_name: '',
device_group: 'ML',
state: '',
city: '',
neighbourhood: '',
datetime: null,
kms: 7.7,
gas: 0.43,
temperature: 0,
cost: 32.03,
co2: 119.75
},
{
full_count: null,
device_name: 'Total general',
person_name: '',
device_group: '',
state: '',
city: '',
neighbourhood: '',
datetime: null,
kms: 7.7,
gas: 0.43,
temperature: 0,
cost: 32.03,
co2: 119.75
}
]{
"status": "ERROR",
"message": "General server error. Please verify your data or contact support."
}{
"status": "ERROR",
"message": "Invalid credentials."
}TOO_MANY_REQUESTS
curl --location --request GET '[API_URL]/rpt_kilometers' \
--header 'tenant: logicsat' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6.....' \
--header 'Content-Type: application/json' \
--data-raw '{
"pagination": {
"limit": 10,
"offset": 0
},
"devices": [],
"perday": true,
"perperson": true,
"subtotals": true,
"groupbygeo": "neighbourhood",
"startdate": "2024-07-08T00:00:00",
"enddate": "2024-07-09T23:59:59"
}'
const axios = require('axios');
const data = {
pagination: {
limit: 10,
offset: 0
},
devices: [],
perday: true,
perperson: true,
subtotals: true,
groupbygeo: 'neighbourhood',
startdate: '2024-07-08T00:00:00',
enddate: '2024-07-09T23:59:59'
};
axios.get('[API_URL]/rpt_kilometers', {
headers: {
'tenant': 'logicsat',
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6.....',
'Content-Type': 'application/json'
},
data: data
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
import requests
url = '[API_URL]/rpt_kilometers'
headers = {
'tenant': 'logicsat',
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6.....',
'Content-Type': 'application/json'
}
data = {
'pagination': {
'limit': 10,
'offset': 0
},
'devices': [],
'perday': True,
'perperson': True,
'subtotals': True,
'groupbygeo': 'neighbourhood',
'startdate': '2024-07-08T00:00:00',
'enddate': '2024-07-09T23:59:59'
}
response = requests.get(url, headers=headers, json=data)
print(response.json())
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace Example
{
class Program
{
static async Task Main(string[] args)
{
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "[API_URL]/rpt_kilometers");
request.Headers.Add("tenant", "logicsat");
request.Headers.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6.....");
request.Headers.Add("Content-Type", "application/json");
var json = "{\"pagination\":{\"limit\":10,\"offset\":0},\"devices\":[],\"perday\":true,\"perperson\":true,\"subtotals\":true,\"groupbygeo\":\"neighbourhood\",\"startdate\":\"2024-07-08T00:00:00\",\"enddate\":\"2024-07-09T23:59:59\"}";
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('[API_URL]/rpt_kilometers')
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri, {
'tenant' => 'logicsat',
'Authorization' => 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6.....',
'Content-Type' => 'application/json'
})
request.body = {
pagination: {
limit: 10,
offset: 0
},
devices: [],
perday: true,
perperson: true,
subtotals: true,
groupbygeo: 'neighbourhood',
startdate: '2024-07-08T00:00:00',
enddate: '2024-07-09T23:59:59'
}.to_json
response = http.request(request)
puts response.body
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class Main {
public static void main(String[] args) {
try {
URL url = new URL("[API_URL]/rpt_kilometers");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("tenant", "logicsat");
con.setRequestProperty("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6.....");
con.setRequestProperty("Content-Type", "application/json");
con.setDoOutput(true);
String jsonInputString = "{\"pagination\":{\"limit\":10,\"offset\":0},\"devices\":[],\"perday\":true,\"perperson\":true,\"subtotals\":true,\"groupbygeo\":\"neighbourhood\",\"startdate\":\"2024-07-08T00:00:00\",\"enddate\":\"2024-07-09T23:59:59\"}";
try(OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int status = con.getResponseCode();
System.out.println("Response Code: " + status);
try(BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(), StandardCharsets.UTF_8))) {
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Last updated