curl --request POST \
--url https://api.ugps.io/api/assets/qr/{code}/power-cut \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.ugps.io/api/assets/qr/{code}/power-cut"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.ugps.io/api/assets/qr/{code}/power-cut', 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/assets/qr/{code}/power-cut",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ugps.io/api/assets/qr/{code}/power-cut"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ugps.io/api/assets/qr/{code}/power-cut")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/assets/qr/{code}/power-cut")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"state": "cut",
"hasPendingChange": true,
"updatedAt": "2023-11-07T05:31:56Z",
"supportsState": true,
"confirmed": true
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "Recurso no encontrado"
}{
"status": "failed",
"code": "POWER_CUT_VEHICLE_MOVING",
"message": "El vehículo está en movimiento. Detenelo e intentá de nuevo."
}{
"status": "failed",
"code": "INSPECTION_QR_REVOKED",
"message": "Este QR ya no es válido"
}{
"message": "Error interno del servidor"
}Cortar o liberar el cortacorriente desde el QR del activo
Acción de la función powerCut del QR del activo (#3643), desde la aplicación del
conductor. El QR tiene que estar vigente y el activo al alcance de la sesión; el tracker
principal del activo, con qrPowerCutEnabled (lo enciende UGPS desde el panel admin).
Siempre corre en modo seguro:
- Cortar solo con el equipo conectado, con un mensaje de menos de 6 minutos y a 5 km/h o menos; si no, 409 con el motivo y no se envía nada.
- El request espera hasta 10 s la confirmación del equipo. En Teltonika, si el setting sigue
pendiente, se cancela y responde 409
POWER_CUT_NOT_CONFIRMED: el corte nunca se aplica tarde. Si la cancelación falla, 409POWER_CUT_STATE_UNKNOWN. - Liberar no pasa por el guard; si queda pendiente, responde
confirmed: falseyhasPendingChange: true. - Con estado conocido, pedir el estado ya aplicado responde 409
POWER_CUT_INVALID_TRANSITION; conunknown(GV20, BTG01L) se acepta cualquier acción.
Cada intento queda en el Registro de actividades (power_cut_activated /
power_cut_deactivated, con status: failure y el motivo si no se aplicó) y en el
historial del cortacorriente del activo.
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).
curl --request POST \
--url https://api.ugps.io/api/assets/qr/{code}/power-cut \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.ugps.io/api/assets/qr/{code}/power-cut"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.ugps.io/api/assets/qr/{code}/power-cut', 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/assets/qr/{code}/power-cut",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ugps.io/api/assets/qr/{code}/power-cut"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ugps.io/api/assets/qr/{code}/power-cut")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/assets/qr/{code}/power-cut")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"state": "cut",
"hasPendingChange": true,
"updatedAt": "2023-11-07T05:31:56Z",
"supportsState": true,
"confirmed": true
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "Recurso no encontrado"
}{
"status": "failed",
"code": "POWER_CUT_VEHICLE_MOVING",
"message": "El vehículo está en movimiento. Detenelo e intentá de nuevo."
}{
"status": "failed",
"code": "INSPECTION_QR_REVOKED",
"message": "Este QR ya no es válido"
}{
"message": "Error interno del servidor"
}Authorizations
Body
Response
Resultado del comando
Estado del cortacorriente tal como lo confirmó el equipo (el setting de outputs en Flespi), no la telemetría.

