Vista previa de un lote de últimos servicios
curl --request POST \
--url https://api.ugps.io/api/maintenance/programs/{id}/last-services/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rows": [
{
"asset": "<string>",
"task": "<string>",
"odometer": 1,
"engineHours": 1,
"date": "2023-12-25"
}
]
}
'import requests
url = "https://api.ugps.io/api/maintenance/programs/{id}/last-services/preview"
payload = { "rows": [
{
"asset": "<string>",
"task": "<string>",
"odometer": 1,
"engineHours": 1,
"date": "2023-12-25"
}
] }
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({
rows: [
{
asset: '<string>',
task: '<string>',
odometer: 1,
engineHours: 1,
date: '2023-12-25'
}
]
})
};
fetch('https://api.ugps.io/api/maintenance/programs/{id}/last-services/preview', 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/maintenance/programs/{id}/last-services/preview",
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([
'rows' => [
[
'asset' => '<string>',
'task' => '<string>',
'odometer' => 1,
'engineHours' => 1,
'date' => '2023-12-25'
]
]
]),
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/maintenance/programs/{id}/last-services/preview"
payload := strings.NewReader("{\n \"rows\": [\n {\n \"asset\": \"<string>\",\n \"task\": \"<string>\",\n \"odometer\": 1,\n \"engineHours\": 1,\n \"date\": \"2023-12-25\"\n }\n ]\n}")
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/maintenance/programs/{id}/last-services/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rows\": [\n {\n \"asset\": \"<string>\",\n \"task\": \"<string>\",\n \"odometer\": 1,\n \"engineHours\": 1,\n \"date\": \"2023-12-25\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/maintenance/programs/{id}/last-services/preview")
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 = "{\n \"rows\": [\n {\n \"asset\": \"<string>\",\n \"task\": \"<string>\",\n \"odometer\": 1,\n \"engineHours\": 1,\n \"date\": \"2023-12-25\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"rows": [
{
"index": 123,
"status": "updated",
"asset": {
"id": "<string>",
"label": "<string>"
},
"task": {
"id": "<string>",
"code": "<string>",
"name": "<string>"
},
"reason": {
"code": "<string>",
"message": "<string>"
},
"reading": {
"odometer": {
"value": 123,
"source": "tracker"
},
"engineHours": {
"value": 123,
"source": "tracker"
}
},
"reviews": [
{
"kind": "odometer",
"reason": "no_reading",
"cyclesBehind": 123
}
],
"before": {
"odometer": 123,
"engineHours": 123,
"date": "2023-12-25",
"assumed": [
"odometer"
]
},
"after": {
"odometer": 123,
"engineHours": 123,
"date": "2023-12-25",
"assumed": [
"odometer"
]
},
"service": {
"odometer": 123,
"engineHours": 123,
"date": "2023-12-25"
},
"serviceItemId": "<string>",
"kind": "correction",
"currentService": {
"itemId": "<string>",
"origin": "program",
"registeredAt": "2023-11-07T05:31:56Z",
"service": {
"odometer": 123,
"engineHours": 123,
"date": "2023-12-25"
},
"workOrder": {
"id": "<string>",
"workOrderNumber": 123,
"completedDay": "2023-12-25"
}
}
}
],
"summary": {
"updated": 123,
"unchanged": 123,
"review": 123,
"rejected": 123,
"needsDecision": 123
}
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"error": "Recurso no encontrado"
}{
"status": "failed",
"code": "TRACKER_SENSOR_DIN_CONFLICT",
"message": "Esa entrada digital ya está asignada a otro sensor del dispositivo"
}{
"message": "Error interno del servidor"
}Mantenimiento - Pautas
Vista previa de un lote de últimos servicios
Resuelve y valida las filas igual que la carga y devuelve el mismo resultado por fila, sin guardar nada. Es una consulta: no deja evento en el Registro de actividades y el asistente la usa con permiso de lectura.
POST
/
api
/
maintenance
/
programs
/
{id}
/
last-services
/
preview
Vista previa de un lote de últimos servicios
curl --request POST \
--url https://api.ugps.io/api/maintenance/programs/{id}/last-services/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rows": [
{
"asset": "<string>",
"task": "<string>",
"odometer": 1,
"engineHours": 1,
"date": "2023-12-25"
}
]
}
'import requests
url = "https://api.ugps.io/api/maintenance/programs/{id}/last-services/preview"
payload = { "rows": [
{
"asset": "<string>",
"task": "<string>",
"odometer": 1,
"engineHours": 1,
"date": "2023-12-25"
}
] }
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({
rows: [
{
asset: '<string>',
task: '<string>',
odometer: 1,
engineHours: 1,
date: '2023-12-25'
}
]
})
};
fetch('https://api.ugps.io/api/maintenance/programs/{id}/last-services/preview', 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/maintenance/programs/{id}/last-services/preview",
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([
'rows' => [
[
'asset' => '<string>',
'task' => '<string>',
'odometer' => 1,
'engineHours' => 1,
'date' => '2023-12-25'
]
]
]),
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/maintenance/programs/{id}/last-services/preview"
payload := strings.NewReader("{\n \"rows\": [\n {\n \"asset\": \"<string>\",\n \"task\": \"<string>\",\n \"odometer\": 1,\n \"engineHours\": 1,\n \"date\": \"2023-12-25\"\n }\n ]\n}")
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/maintenance/programs/{id}/last-services/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rows\": [\n {\n \"asset\": \"<string>\",\n \"task\": \"<string>\",\n \"odometer\": 1,\n \"engineHours\": 1,\n \"date\": \"2023-12-25\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/maintenance/programs/{id}/last-services/preview")
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 = "{\n \"rows\": [\n {\n \"asset\": \"<string>\",\n \"task\": \"<string>\",\n \"odometer\": 1,\n \"engineHours\": 1,\n \"date\": \"2023-12-25\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"rows": [
{
"index": 123,
"status": "updated",
"asset": {
"id": "<string>",
"label": "<string>"
},
"task": {
"id": "<string>",
"code": "<string>",
"name": "<string>"
},
"reason": {
"code": "<string>",
"message": "<string>"
},
"reading": {
"odometer": {
"value": 123,
"source": "tracker"
},
"engineHours": {
"value": 123,
"source": "tracker"
}
},
"reviews": [
{
"kind": "odometer",
"reason": "no_reading",
"cyclesBehind": 123
}
],
"before": {
"odometer": 123,
"engineHours": 123,
"date": "2023-12-25",
"assumed": [
"odometer"
]
},
"after": {
"odometer": 123,
"engineHours": 123,
"date": "2023-12-25",
"assumed": [
"odometer"
]
},
"service": {
"odometer": 123,
"engineHours": 123,
"date": "2023-12-25"
},
"serviceItemId": "<string>",
"kind": "correction",
"currentService": {
"itemId": "<string>",
"origin": "program",
"registeredAt": "2023-11-07T05:31:56Z",
"service": {
"odometer": 123,
"engineHours": 123,
"date": "2023-12-25"
},
"workOrder": {
"id": "<string>",
"workOrderNumber": 123,
"completedDay": "2023-12-25"
}
}
}
],
"summary": {
"updated": 123,
"unchanged": 123,
"review": 123,
"rejected": 123,
"needsDecision": 123
}
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"error": "Recurso no encontrado"
}{
"status": "failed",
"code": "TRACKER_SENSOR_DIN_CONFLICT",
"message": "Esa entrada digital ya está asignada a otro sensor del dispositivo"
}{
"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.
Path Parameters
Body
application/json

