Iniciar sesión
curl --request POST \
--url https://docs.pymo.uy/v1/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "usuario@tuempresa.com",
"password": "tu-contraseña"
}
'import requests
url = "https://docs.pymo.uy/v1/login"
payload = {
"email": "usuario@tuempresa.com",
"password": "tu-contraseña"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'usuario@tuempresa.com', password: 'tu-contraseña'})
};
fetch('https://docs.pymo.uy/v1/login', 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://docs.pymo.uy/v1/login",
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([
'email' => 'usuario@tuempresa.com',
'password' => 'tu-contraseña'
]),
CURLOPT_HTTPHEADER => [
"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://docs.pymo.uy/v1/login"
payload := strings.NewReader("{\n \"email\": \"usuario@tuempresa.com\",\n \"password\": \"tu-contraseña\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://docs.pymo.uy/v1/login")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"usuario@tuempresa.com\",\n \"password\": \"tu-contraseña\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docs.pymo.uy/v1/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"usuario@tuempresa.com\",\n \"password\": \"tu-contraseña\"\n}"
response = http.request(request)
puts response.read_body{
"payload": {
"email": "e@e.com"
},
"message": {
"code": "LOGGED_IN",
"value": "Sessión iniciada correctamente."
},
"status": "SUCCESS"
}1 Autenticación
Iniciar sesión
Inicia la sesión y setea la cookie connect.sid que necesitan todas las demás llamadas.
Acceso: pública. No requiere sesión.
POST
/
v1
/
login
Iniciar sesión
curl --request POST \
--url https://docs.pymo.uy/v1/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "usuario@tuempresa.com",
"password": "tu-contraseña"
}
'import requests
url = "https://docs.pymo.uy/v1/login"
payload = {
"email": "usuario@tuempresa.com",
"password": "tu-contraseña"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'usuario@tuempresa.com', password: 'tu-contraseña'})
};
fetch('https://docs.pymo.uy/v1/login', 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://docs.pymo.uy/v1/login",
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([
'email' => 'usuario@tuempresa.com',
'password' => 'tu-contraseña'
]),
CURLOPT_HTTPHEADER => [
"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://docs.pymo.uy/v1/login"
payload := strings.NewReader("{\n \"email\": \"usuario@tuempresa.com\",\n \"password\": \"tu-contraseña\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://docs.pymo.uy/v1/login")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"usuario@tuempresa.com\",\n \"password\": \"tu-contraseña\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docs.pymo.uy/v1/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"usuario@tuempresa.com\",\n \"password\": \"tu-contraseña\"\n}"
response = http.request(request)
puts response.read_body{
"payload": {
"email": "e@e.com"
},
"message": {
"code": "LOGGED_IN",
"value": "Sessión iniciada correctamente."
},
"status": "SUCCESS"
}Cuerpo
application/json
Respuesta
200 - application/json
Éxito
Envoltorio común a todas las respuestas. status no se deduce del código HTTP: hay al menos nueve lugares en el gateway que responden HTTP 200 con status: "FAIL" (por ejemplo CFE_NOT_FOUND y DGI_COMPANY_NOT_READY_YET). Un cliente tiene que leer status, no el código.
Los datos de la respuesta. {} cuando el endpoint no devuelve nada.
De las 82 claves de mensaje del gateway, 29 son SUCCESS y 53 FAIL. Es lo que hay que mirar para saber si la llamada funcionó.
Opciones disponibles:
SUCCESS, FAIL Presente cuando la operación tiene algo que decir. Las lecturas simples responden sólo payload y status.
Show child attributes
Show child attributes