curl --request GET \
--url https://api.ugps.io/api/power-cut/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ugps.io/api/power-cut/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ugps.io/api/power-cut/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.ugps.io/api/power-cut/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: Bearer <token>"
],
]);
$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.ugps.io/api/power-cut/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.ugps.io/api/power-cut/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/power-cut/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"events": [
{
"id": "<string>",
"action": "cut",
"source": "qr",
"result": "confirmed",
"reason": "device_offline",
"guard": {
"deviceConnected": true,
"speedKmh": 123,
"positionAgeSeconds": 123
},
"actor": {
"userId": "<string>",
"name": "<string>",
"driverRut": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"asset": {
"id": "<string>",
"name": "<string>",
"plate": "<string>"
}
}
],
"nextCursor": "<string>"
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"message": "Error interno del servidor"
}Historial del cortacorriente de la empresa
Los comandos de cortacorriente sobre todos los activos al alcance de la sesión, del más
nuevo al más viejo, con el mismo detalle que el historial de la ficha más el activo de
cada evento (asset, o null si el tracker no estaba en un activo o el activo se borró).
Es el «Historial» del apartado Cortacorrientes de la aplicación del conductor (#3643).
Paginado por cursor: before es el nextCursor de la página anterior; sin él, la primera.
Permisos requeridos: access_power_cut (la sesión de la aplicación del conductor lo
recibe salvo que la empresa tenga bloqueado el módulo Cortacorrientes), sobre los activos
permitidos del usuario.
curl --request GET \
--url https://api.ugps.io/api/power-cut/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ugps.io/api/power-cut/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ugps.io/api/power-cut/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.ugps.io/api/power-cut/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: Bearer <token>"
],
]);
$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.ugps.io/api/power-cut/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.ugps.io/api/power-cut/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/power-cut/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"events": [
{
"id": "<string>",
"action": "cut",
"source": "qr",
"result": "confirmed",
"reason": "device_offline",
"guard": {
"deviceConnected": true,
"speedKmh": 123,
"positionAgeSeconds": 123
},
"actor": {
"userId": "<string>",
"name": "<string>",
"driverRut": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"asset": {
"id": "<string>",
"name": "<string>",
"plate": "<string>"
}
}
],
"nextCursor": "<string>"
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"message": "Error interno del servidor"
}Authorizations
Token de sesión Better Auth o API token (atk_...) en el header Authorization: Bearer <token>. Los JWT legacy ya no son válidos.
Query Parameters
Eventos por página (1 a 200; por defecto 50).
1 <= x <= 200Cursor opaco de la página anterior (nextCursor).

