Editar una ruta
curl --request PATCH \
--url https://api.ugps.io/api/work/tasks/routes/{routeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"description": "<string>",
"checkpoints": [
{
"id": 123,
"label": "<string>",
"description": "<string>",
"from": "<string>",
"to": "<string>"
}
]
}
'import requests
url = "https://api.ugps.io/api/work/tasks/routes/{routeId}"
payload = {
"label": "<string>",
"description": "<string>",
"checkpoints": [
{
"id": 123,
"label": "<string>",
"description": "<string>",
"from": "<string>",
"to": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
description: '<string>',
checkpoints: [
{
id: 123,
label: '<string>',
description: '<string>',
from: '<string>',
to: '<string>'
}
]
})
};
fetch('https://api.ugps.io/api/work/tasks/routes/{routeId}', 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/work/tasks/routes/{routeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'description' => '<string>',
'checkpoints' => [
[
'id' => 123,
'label' => '<string>',
'description' => '<string>',
'from' => '<string>',
'to' => '<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/work/tasks/routes/{routeId}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"checkpoints\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.ugps.io/api/work/tasks/routes/{routeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"checkpoints\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/work/tasks/routes/{routeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"checkpoints\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": 123,
"label": "<string>",
"description": "<string>",
"trackerId": 123,
"status": "<string>",
"from": "<string>",
"to": "<string>",
"checkpointIds": [
123
],
"checkpoints": [
{
"id": "<string>",
"userId": "<string>",
"trackerId": "<string>",
"status": "<string>",
"statusChangeDate": "<string>",
"label": "<string>",
"description": "<string>",
"externalId": "<string>",
"creationDate": "<string>",
"location": {
"latitude": 123,
"longitude": 123,
"address": "<string>",
"radius": 123
},
"address": "<string>",
"from": "<string>",
"to": "<string>",
"arrivalDate": "<string>",
"stayDuration": 123,
"minStayDuration": 123,
"maxDelay": 123,
"minArrivalDuration": 123,
"type": "<string>",
"tags": [
123
],
"employee": {
"id": "<string>",
"trackerId": "<string>",
"firstName": "<string>",
"middleName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"email": "<string>",
"phone": "<string>"
},
"form": {}
}
]
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"error": "Recurso no encontrado"
}{
"message": "Error interno del servidor"
}Trabajo - Tareas
Editar una ruta
Edita el nombre, la descripción o las paradas de una ruta en estado unassigned o
assigned. Lo omitido se conserva: el proveedor reemplaza la ruta entera, pero Atlas
la lee antes y reenvía lo que no cambia. checkpoints es la lista completa y ordenada
con que queda la ruta: una parada con id se conserva (y se edita lo que traiga), una
sin id se crea y la que no viaja se borra.
Permisos requeridos: access_tasks
PATCH
/
api
/
work
/
tasks
/
routes
/
{routeId}
Editar una ruta
curl --request PATCH \
--url https://api.ugps.io/api/work/tasks/routes/{routeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"description": "<string>",
"checkpoints": [
{
"id": 123,
"label": "<string>",
"description": "<string>",
"from": "<string>",
"to": "<string>"
}
]
}
'import requests
url = "https://api.ugps.io/api/work/tasks/routes/{routeId}"
payload = {
"label": "<string>",
"description": "<string>",
"checkpoints": [
{
"id": 123,
"label": "<string>",
"description": "<string>",
"from": "<string>",
"to": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
description: '<string>',
checkpoints: [
{
id: 123,
label: '<string>',
description: '<string>',
from: '<string>',
to: '<string>'
}
]
})
};
fetch('https://api.ugps.io/api/work/tasks/routes/{routeId}', 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/work/tasks/routes/{routeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'description' => '<string>',
'checkpoints' => [
[
'id' => 123,
'label' => '<string>',
'description' => '<string>',
'from' => '<string>',
'to' => '<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/work/tasks/routes/{routeId}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"checkpoints\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.ugps.io/api/work/tasks/routes/{routeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"checkpoints\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/work/tasks/routes/{routeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"checkpoints\": [\n {\n \"id\": 123,\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": 123,
"label": "<string>",
"description": "<string>",
"trackerId": 123,
"status": "<string>",
"from": "<string>",
"to": "<string>",
"checkpointIds": [
123
],
"checkpoints": [
{
"id": "<string>",
"userId": "<string>",
"trackerId": "<string>",
"status": "<string>",
"statusChangeDate": "<string>",
"label": "<string>",
"description": "<string>",
"externalId": "<string>",
"creationDate": "<string>",
"location": {
"latitude": 123,
"longitude": 123,
"address": "<string>",
"radius": 123
},
"address": "<string>",
"from": "<string>",
"to": "<string>",
"arrivalDate": "<string>",
"stayDuration": 123,
"minStayDuration": 123,
"maxDelay": 123,
"minArrivalDuration": 123,
"type": "<string>",
"tags": [
123
],
"employee": {
"id": "<string>",
"trackerId": "<string>",
"firstName": "<string>",
"middleName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"email": "<string>",
"phone": "<string>"
},
"form": {}
}
]
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}{
"error": "No tiene permisos para realizar esta acción"
}{
"error": "Recurso no encontrado"
}{
"message": "Error interno del servidor"
}Authorizations
bearerAuthcookieAuth
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
ID de la ruta (entero positivo)
Required range:
x >= 1Body
application/json