curl --request POST \
--url https://api.ugps.io/api/module-store/requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"moduleKey": "data",
"phone": "+56 9 1234 5678",
"comment": "<string>"
}
'import requests
url = "https://api.ugps.io/api/module-store/requests"
payload = {
"moduleKey": "data",
"phone": "+56 9 1234 5678",
"comment": "<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({moduleKey: 'data', phone: '+56 9 1234 5678', comment: '<string>'})
};
fetch('https://api.ugps.io/api/module-store/requests', 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/module-store/requests",
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([
'moduleKey' => 'data',
'phone' => '+56 9 1234 5678',
'comment' => '<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/module-store/requests"
payload := strings.NewReader("{\n \"moduleKey\": \"data\",\n \"phone\": \"+56 9 1234 5678\",\n \"comment\": \"<string>\"\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/module-store/requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"moduleKey\": \"data\",\n \"phone\": \"+56 9 1234 5678\",\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/module-store/requests")
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 \"moduleKey\": \"data\",\n \"phone\": \"+56 9 1234 5678\",\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"moduleKey": "data",
"status": "request_sent"
}
}{
"status": "success",
"data": {
"moduleKey": "data",
"status": "request_sent"
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}Solicitar un módulo de la tienda
Cualquier usuario de la empresa puede solicitar una tarjeta en requestable o en client_has_access; en ese caso pide acceso a un módulo que la empresa ya tiene y la respuesta trae access_requested en vez de request_sent. Atlas reserva la solicitud y crea la Oportunidad en Raúl con el nombre y el correo del usuario de la sesión; la empresa y la clave de idempotencia las pone Atlas, nunca el navegador. Si la empresa ya tenía una solicitud abierta o ganada del módulo responde 200 con el mismo estado, sin volver a pedirlo. Si Raúl falla, la tarjeta sigue para solicitar: tras un timeout o un 5xx la reserva queda pendiente y el próximo intento, de cualquier usuario de la empresa, reenvía la misma clave; si Raúl la rechazó, la reserva se borra. En una sesión como usuario de una persona de UGPS la solicitud sigue a nombre del usuario, registra a esa persona y la nota de la oportunidad lo dice.
curl --request POST \
--url https://api.ugps.io/api/module-store/requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"moduleKey": "data",
"phone": "+56 9 1234 5678",
"comment": "<string>"
}
'import requests
url = "https://api.ugps.io/api/module-store/requests"
payload = {
"moduleKey": "data",
"phone": "+56 9 1234 5678",
"comment": "<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({moduleKey: 'data', phone: '+56 9 1234 5678', comment: '<string>'})
};
fetch('https://api.ugps.io/api/module-store/requests', 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/module-store/requests",
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([
'moduleKey' => 'data',
'phone' => '+56 9 1234 5678',
'comment' => '<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/module-store/requests"
payload := strings.NewReader("{\n \"moduleKey\": \"data\",\n \"phone\": \"+56 9 1234 5678\",\n \"comment\": \"<string>\"\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/module-store/requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"moduleKey\": \"data\",\n \"phone\": \"+56 9 1234 5678\",\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ugps.io/api/module-store/requests")
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 \"moduleKey\": \"data\",\n \"phone\": \"+56 9 1234 5678\",\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"moduleKey": "data",
"status": "request_sent"
}
}{
"status": "success",
"data": {
"moduleKey": "data",
"status": "request_sent"
}
}{
"error": "El email es requerido"
}{
"error": "Token inválido o expirado"
}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
Clave de la tarjeta del catálogo.
"data"
Teléfono que el usuario confirmó o corrigió en el diálogo, que lo precarga del perfil; vacío o null llega a Raúl sin teléfono, sin volver al del perfil.
50"+56 9 1234 5678"
Para qué necesita el módulo; opcional.
2000
