Importar conductores
curl --request POST \
--url https://api.ugps.io/api/drivers/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rows": [
{
"row": 2,
"firstName": "<string>",
"lastName": "<string>",
"rut": "12345678-K",
"phone": "+56912345678",
"email": "<string>",
"address": "<string>",
"city": "<string>"
}
]
}
'import requests
url = "https://api.ugps.io/api/drivers/import"
payload = { "rows": [
{
"row": 2,
"firstName": "<string>",
"lastName": "<string>",
"rut": "12345678-K",
"phone": "+56912345678",
"email": "<string>",
"address": "<string>",
"city": "<string>"
}
] }
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: [
{
row: 2,
firstName: '<string>',
lastName: '<string>',
rut: '12345678-K',
phone: '+56912345678',
email: '<string>',
address: '<string>',
city: '<string>'
}
]
})
};
fetch('https://api.ugps.io/api/drivers/import', 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/drivers/import",
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' => [
[
'row' => 2,
'firstName' => '<string>',
'lastName' => '<string>',
'rut' => '12345678-K',
'phone' => '+56912345678',
'email' => '<string>',
'address' => '<string>',
'city' => '<string>'
]
]
]),
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/drivers/import"
payload := strings.NewReader("{\n \"rows\": [\n {\n \"row\": 2,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"rut\": \"12345678-K\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\"\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/drivers/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rows\": [\n {\n \"row\": 2,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"rut\": \"12345678-K\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/drivers/import")
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 \"row\": 2,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"rut\": \"12345678-K\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"createdCount": 123,
"failedRows": [
{
"row": 123,
"reason": "<string>",
"data": {
"firstName": "<string>",
"lastName": "<string>",
"rut": "<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"
}Otros - Conductores
Importar conductores
Crea los conductores confirmados en la vista previa. Cada fila se vuelve a normalizar y validar (cubre lo que cambió entre la vista previa y la confirmación); entran las filas válidas y las rechazadas vuelven con su motivo. Máximo 1.000 filas por llamada.
Permisos requeridos: access_drivers
POST
/
api
/
drivers
/
import
Importar conductores
curl --request POST \
--url https://api.ugps.io/api/drivers/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rows": [
{
"row": 2,
"firstName": "<string>",
"lastName": "<string>",
"rut": "12345678-K",
"phone": "+56912345678",
"email": "<string>",
"address": "<string>",
"city": "<string>"
}
]
}
'import requests
url = "https://api.ugps.io/api/drivers/import"
payload = { "rows": [
{
"row": 2,
"firstName": "<string>",
"lastName": "<string>",
"rut": "12345678-K",
"phone": "+56912345678",
"email": "<string>",
"address": "<string>",
"city": "<string>"
}
] }
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: [
{
row: 2,
firstName: '<string>',
lastName: '<string>',
rut: '12345678-K',
phone: '+56912345678',
email: '<string>',
address: '<string>',
city: '<string>'
}
]
})
};
fetch('https://api.ugps.io/api/drivers/import', 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/drivers/import",
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' => [
[
'row' => 2,
'firstName' => '<string>',
'lastName' => '<string>',
'rut' => '12345678-K',
'phone' => '+56912345678',
'email' => '<string>',
'address' => '<string>',
'city' => '<string>'
]
]
]),
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/drivers/import"
payload := strings.NewReader("{\n \"rows\": [\n {\n \"row\": 2,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"rut\": \"12345678-K\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\"\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/drivers/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rows\": [\n {\n \"row\": 2,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"rut\": \"12345678-K\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/drivers/import")
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 \"row\": 2,\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"rut\": \"12345678-K\",\n \"phone\": \"+56912345678\",\n \"email\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"createdCount": 123,
"failedRows": [
{
"row": 123,
"reason": "<string>",
"data": {
"firstName": "<string>",
"lastName": "<string>",
"rut": "<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.
Body
application/json
Required array length:
1 - 1000 elementsShow child attributes
Show child attributes