Elegir un avatar predefinido para un conductor
curl --request PUT \
--url https://api.ugps.io/api/drivers/{id}/avatar \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"color": "#2C8DDD"
}
'import requests
url = "https://api.ugps.io/api/drivers/{id}/avatar"
payload = { "color": "#2C8DDD" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({color: '#2C8DDD'})
};
fetch('https://api.ugps.io/api/drivers/{id}/avatar', 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/{id}/avatar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'color' => '#2C8DDD'
]),
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/{id}/avatar"
payload := strings.NewReader("{\n \"color\": \"#2C8DDD\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.ugps.io/api/drivers/{id}/avatar")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"color\": \"#2C8DDD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/drivers/{id}/avatar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"color\": \"#2C8DDD\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"rut": "19821574-0",
"firstname": "<string>",
"lastname": "<string>",
"phone": "<string>",
"email": "<string>",
"address": "<string>",
"city": "<string>",
"clientId": "<string>",
"userId": "<string>",
"portalStatus": "active",
"avatar": {
"kind": "preset",
"presetKey": "initial",
"color": "#2C8DDD",
"url": "https://files.ugps.io/avatars/6650f1c2a4b3c2d1e0f9a8b7/drivers/6650f1c2a4b3c2d1e0f9a8b8/3f2b1c9e-8a7d-4c6b-9e5f-1a2b3c4d5e6f.jpg"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"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"
}Otros - Conductores
Elegir un avatar predefinido para un conductor
Deja uno de los avatares predefinidos (inicial, silueta o ilustración de conductor, con su color) como avatar de la ficha. Si la ficha tenía una foto subida, la foto se borra. Queda en el Registro de actividades como edición del conductor.
Permisos requeridos: access_drivers
PUT
/
api
/
drivers
/
{id}
/
avatar
Elegir un avatar predefinido para un conductor
curl --request PUT \
--url https://api.ugps.io/api/drivers/{id}/avatar \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"color": "#2C8DDD"
}
'import requests
url = "https://api.ugps.io/api/drivers/{id}/avatar"
payload = { "color": "#2C8DDD" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({color: '#2C8DDD'})
};
fetch('https://api.ugps.io/api/drivers/{id}/avatar', 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/{id}/avatar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'color' => '#2C8DDD'
]),
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/{id}/avatar"
payload := strings.NewReader("{\n \"color\": \"#2C8DDD\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.ugps.io/api/drivers/{id}/avatar")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"color\": \"#2C8DDD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/drivers/{id}/avatar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"color\": \"#2C8DDD\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"rut": "19821574-0",
"firstname": "<string>",
"lastname": "<string>",
"phone": "<string>",
"email": "<string>",
"address": "<string>",
"city": "<string>",
"clientId": "<string>",
"userId": "<string>",
"portalStatus": "active",
"avatar": {
"kind": "preset",
"presetKey": "initial",
"color": "#2C8DDD",
"url": "https://files.ugps.io/avatars/6650f1c2a4b3c2d1e0f9a8b7/drivers/6650f1c2a4b3c2d1e0f9a8b8/3f2b1c9e-8a7d-4c6b-9e5f-1a2b3c4d5e6f.jpg"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"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
Body
application/json

