Skip to main content
GET
/
devices
/
{id}
/
history
/
events
Historial de eventos
curl --request GET \
  --url https://api.locatebyteli.com/devices/{id}/history/events \
  --header 'Authorization: <authorization>'
import requests

url = "https://api.locatebyteli.com/devices/{id}/history/events"

headers = {"Authorization": "<authorization>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: '<authorization>'}};

fetch('https://api.locatebyteli.com/devices/{id}/history/events', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.locatebyteli.com/devices/{id}/history/events",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: <authorization>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.locatebyteli.com/devices/{id}/history/events"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "<authorization>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.locatebyteli.com/devices/{id}/history/events")
  .header("Authorization", "<authorization>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.locatebyteli.com/devices/{id}/history/events")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'

response = http.request(request)
puts response.read_body
[
  {
    "alarm_code": "SOS",
    "context": { "triggered_by": "button" },
    "speed": 60,
    "satellite": 8,
    "coordinates": [19.4326, -99.1332],
    "mcc": 334,
    "mnc": 20,
    "dbm": -75,
    "timestamp": 1710756000
  },
  {
    "alarm_code": "OVERSPEED",
    "context": { "limit": 80, "actual": 120 },
    "speed": 120,
    "satellite": 10,
    "coordinates": [19.4400, -99.1400],
    "mcc": 334,
    "mnc": 20,
    "dbm": -68,
    "timestamp": 1710757500
  }
]

Authorization

Authorization
string
default:"Bearer "
required
API Key. Formato: Bearer lbt_•••

Path Parameters

id
uuid
required
ID del dispositivo

Query Parameters

from
integer
required
Timestamp Unix de inicio
to
integer
required
Timestamp Unix de fin
También disponible en GET /devices/{id}/events

Respuesta

Array de eventos con la siguiente estructura:
alarm_code
string
Código de la alarma o evento
context
object
Datos adicionales del evento
speed
integer
Velocidad al momento del evento (km/h)
satellite
integer
Satélites GPS captados
coordinates
array
[latitud, longitud]
mcc
integer
Mobile Country Code
mnc
integer
Mobile Network Code
dbm
integer
Intensidad de señal celular
timestamp
integer
Timestamp Unix del evento
[
  {
    "alarm_code": "SOS",
    "context": { "triggered_by": "button" },
    "speed": 60,
    "satellite": 8,
    "coordinates": [19.4326, -99.1332],
    "mcc": 334,
    "mnc": 20,
    "dbm": -75,
    "timestamp": 1710756000
  },
  {
    "alarm_code": "OVERSPEED",
    "context": { "limit": 80, "actual": 120 },
    "speed": 120,
    "satellite": 10,
    "coordinates": [19.4400, -99.1400],
    "mcc": 334,
    "mnc": 20,
    "dbm": -68,
    "timestamp": 1710757500
  }
]

Errores

CódigoDescripción
404Dispositivo no encontrado
500Error en la consulta