curl --request POST \
--url https://api.ugps.io/api/inspections/pdf \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"inspectionId": "68b3f1a2c9d84e1f2a3b4c5d"
}
]
}
'import requests
url = "https://api.ugps.io/api/inspections/pdf"
payload = {
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [{ "inspectionId": "68b3f1a2c9d84e1f2a3b4c5d" }]
}
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({
batchId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
items: [{inspectionId: '68b3f1a2c9d84e1f2a3b4c5d'}]
})
};
fetch('https://api.ugps.io/api/inspections/pdf', 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/inspections/pdf",
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([
'batchId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'items' => [
[
'inspectionId' => '68b3f1a2c9d84e1f2a3b4c5d'
]
]
]),
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/inspections/pdf"
payload := strings.NewReader("{\n \"batchId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"inspectionId\": \"68b3f1a2c9d84e1f2a3b4c5d\"\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/inspections/pdf")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"batchId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"inspectionId\": \"68b3f1a2c9d84e1f2a3b4c5d\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/inspections/pdf")
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 \"batchId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"inspectionId\": \"68b3f1a2c9d84e1f2a3b4c5d\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}Descargar los PDFs de varias inspecciones en un ZIP
Genera el PDF de cada inspección seleccionada y responde un ZIP que se streamea a
medida que los PDFs terminan (la conexión no queda inactiva). Cada entrada usa el mismo
nombre que la descarga individual (inspeccion_<patente|activo>_<fecha>_<id>.pdf). Las
inspecciones que fallan no frenan el lote: van a errores.txt, al final del ZIP, con id
y motivo (Inspección no encontrada, Tiempo agotado, Error al generar el PDF). Una
inspección de otro cliente o de un activo fuera del alcance del usuario se reporta como
Inspección no encontrada, igual que en el detalle.
Un usuario solo puede tener una descarga masiva en curso (409). Con una sola inspección
conviene usar el endpoint individual. Como el ZIP se streamea, el resultado se consulta
después en GET /api/inspections/pdf/{batchId}/summary.
Permiso requerido: access_inspections
curl --request POST \
--url https://api.ugps.io/api/inspections/pdf \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"inspectionId": "68b3f1a2c9d84e1f2a3b4c5d"
}
]
}
'import requests
url = "https://api.ugps.io/api/inspections/pdf"
payload = {
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [{ "inspectionId": "68b3f1a2c9d84e1f2a3b4c5d" }]
}
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({
batchId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
items: [{inspectionId: '68b3f1a2c9d84e1f2a3b4c5d'}]
})
};
fetch('https://api.ugps.io/api/inspections/pdf', 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/inspections/pdf",
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([
'batchId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'items' => [
[
'inspectionId' => '68b3f1a2c9d84e1f2a3b4c5d'
]
]
]),
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/inspections/pdf"
payload := strings.NewReader("{\n \"batchId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"inspectionId\": \"68b3f1a2c9d84e1f2a3b4c5d\"\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/inspections/pdf")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"batchId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"inspectionId\": \"68b3f1a2c9d84e1f2a3b4c5d\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/inspections/pdf")
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 \"batchId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"items\": [\n {\n \"inspectionId\": \"68b3f1a2c9d84e1f2a3b4c5d\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}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.
Body
Response
ZIP inspecciones_<YYYY-MM-DD>.zip con un PDF por inspección y, si hubo fallos, errores.txt.
The response is of type file.