curl --request GET \
--url https://api.ugps.io/api/maintenance/dashboard/costs \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ugps.io/api/maintenance/dashboard/costs"
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/maintenance/dashboard/costs', 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/dashboard/costs",
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/maintenance/dashboard/costs"
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/maintenance/dashboard/costs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/maintenance/dashboard/costs")
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{
"status": "success",
"data": {
"from": "2023-12-25",
"to": "2023-12-25",
"totals": {
"total": 123,
"labor": 123,
"parts": 123,
"other": 123,
"workOrderCount": 123,
"assetCount": 123
},
"byMonth": [
{
"month": "2026-01",
"total": 123
}
],
"byCategory": [
{
"key": "<string>",
"label": "<string>",
"total": 123,
"count": 123
}
],
"byServiceTaskCategory": [
{
"key": "<string>",
"label": "<string>",
"total": 123,
"count": 123
}
],
"byVendor": [
{
"key": "<string>",
"label": "<string>",
"total": 123,
"count": 123
}
],
"topAssets": [
{
"key": "<string>",
"label": "<string>",
"plate": "<string>",
"total": 123,
"count": 123
}
]
}
}{
"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"
}Costos de mantención de la flota en un período
Suma el costo de las OT cerradas (completed o closed) cuyo completedDate cae en
el período pedido (días de Chile, ambos inclusive; sin período, el año en curso
completo). Una OT importada, con completedDate a medianoche UTC exacta, cuenta en esa
fecha calendario. Los meses también son de Chile. El costo de cada OT es la suma de sus tareas de servicio. Devuelve
totales (mano de obra y repuestos salen de las tareas; other es el resto: las líneas
«otros costos» y las OT importadas sin tareas), el costo por mes y los desgloses
por categoría de OT, categoría de tarea, taller y los 10 activos de mayor costo.
Permisos requeridos: access_maintenance
curl --request GET \
--url https://api.ugps.io/api/maintenance/dashboard/costs \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ugps.io/api/maintenance/dashboard/costs"
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/maintenance/dashboard/costs', 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/dashboard/costs",
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/maintenance/dashboard/costs"
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/maintenance/dashboard/costs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/maintenance/dashboard/costs")
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{
"status": "success",
"data": {
"from": "2023-12-25",
"to": "2023-12-25",
"totals": {
"total": 123,
"labor": 123,
"parts": 123,
"other": 123,
"workOrderCount": 123,
"assetCount": 123
},
"byMonth": [
{
"month": "2026-01",
"total": 123
}
],
"byCategory": [
{
"key": "<string>",
"label": "<string>",
"total": 123,
"count": 123
}
],
"byServiceTaskCategory": [
{
"key": "<string>",
"label": "<string>",
"total": 123,
"count": 123
}
],
"byVendor": [
{
"key": "<string>",
"label": "<string>",
"total": 123,
"count": 123
}
],
"topAssets": [
{
"key": "<string>",
"label": "<string>",
"plate": "<string>",
"total": 123,
"count": 123
}
]
}
}{
"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
Fecha de inicio (AAAA-MM-DD), inclusive. Va junto con to.
Fecha de término (AAAA-MM-DD), inclusive. Va junto con from.

