curl --request GET \
--url https://docs.pymo.uy/v1/companies/{companyRut} \
--cookie connect.sid=import requests
url = "https://docs.pymo.uy/v1/companies/{companyRut}"
headers = {"cookie": "connect.sid="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'connect.sid='}};
fetch('https://docs.pymo.uy/v1/companies/{companyRut}', 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/companies/{companyRut}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "connect.sid=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://docs.pymo.uy/v1/companies/{companyRut}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "connect.sid=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://docs.pymo.uy/v1/companies/{companyRut}")
.header("cookie", "connect.sid=")
.asString();require 'uri'
require 'net/http'
url = URI("https://docs.pymo.uy/v1/companies/{companyRut}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'connect.sid='
response = http.request(request)
puts response.read_body{
"payload": {
"company": {
"_id": "5a3d849be1fb0d35e5c0d691",
"updatedAt": "2017-12-22T22:24:55.826Z",
"createdAt": "2017-12-22T22:18:03.190Z",
"rut": "219999990008",
"socialPurpose": "CompanySocialPurpose",
"resolutionNumber": "3652/2018",
"email": "motion@soft.com",
"__v": 0,
"deleted": false,
"nextReporteIdEmitedMsg": {
"usedDay": "2017-12-22T22:18:03.178Z",
"num": "0"
},
"nextCfeIdEmitedMsg": 6,
"branchOffices": [
{
"email": "motion@soft.com",
"name": "Branch office name",
"number": "1",
"fiscalAddress": "Company address",
"city": "Cerro Largo",
"state": "Mozambique",
"callbackNotificationUrl": {
"pymo": "http://someurl.com/",
"payments": "http://payments.someurl.com/"
},
"_id": "5a3d849be1fb0d35e5c0d692"
}
],
"cfePrintSpecs": {
"size": 22,
"margin": 3,
"imageType": "pdf"
},
"url": "/companies/219999990008",
"id": "5a3d849be1fb0d35e5c0d691"
}
},
"status": "SUCCESS"
}{
"payload": {},
"message": {
"code": "UNAUTHORIZED",
"value": "Debe iniciar sesión."
},
"status": "FAIL"
}{
"payload": {},
"message": {
"code": "FORBIDDEN",
"value": "No tiene permisos para realizar esta acción."
},
"status": "FAIL"
}Obtener los datos de la empresa
Lee los datos y la configuración de la empresa.
Acceso: restringida. Requiere sesión, y sólo opera sobre el RUT de tu propia empresa: pedir otro RUT responde 403 FORBIDDEN.
Ver Filtrado para filtrar los resultados.
curl --request GET \
--url https://docs.pymo.uy/v1/companies/{companyRut} \
--cookie connect.sid=import requests
url = "https://docs.pymo.uy/v1/companies/{companyRut}"
headers = {"cookie": "connect.sid="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'connect.sid='}};
fetch('https://docs.pymo.uy/v1/companies/{companyRut}', 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/companies/{companyRut}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "connect.sid=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://docs.pymo.uy/v1/companies/{companyRut}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "connect.sid=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://docs.pymo.uy/v1/companies/{companyRut}")
.header("cookie", "connect.sid=")
.asString();require 'uri'
require 'net/http'
url = URI("https://docs.pymo.uy/v1/companies/{companyRut}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'connect.sid='
response = http.request(request)
puts response.read_body{
"payload": {
"company": {
"_id": "5a3d849be1fb0d35e5c0d691",
"updatedAt": "2017-12-22T22:24:55.826Z",
"createdAt": "2017-12-22T22:18:03.190Z",
"rut": "219999990008",
"socialPurpose": "CompanySocialPurpose",
"resolutionNumber": "3652/2018",
"email": "motion@soft.com",
"__v": 0,
"deleted": false,
"nextReporteIdEmitedMsg": {
"usedDay": "2017-12-22T22:18:03.178Z",
"num": "0"
},
"nextCfeIdEmitedMsg": 6,
"branchOffices": [
{
"email": "motion@soft.com",
"name": "Branch office name",
"number": "1",
"fiscalAddress": "Company address",
"city": "Cerro Largo",
"state": "Mozambique",
"callbackNotificationUrl": {
"pymo": "http://someurl.com/",
"payments": "http://payments.someurl.com/"
},
"_id": "5a3d849be1fb0d35e5c0d692"
}
],
"cfePrintSpecs": {
"size": 22,
"margin": 3,
"imageType": "pdf"
},
"url": "/companies/219999990008",
"id": "5a3d849be1fb0d35e5c0d691"
}
},
"status": "SUCCESS"
}{
"payload": {},
"message": {
"code": "UNAUTHORIZED",
"value": "Debe iniciar sesión."
},
"status": "FAIL"
}{
"payload": {},
"message": {
"code": "FORBIDDEN",
"value": "No tiene permisos para realizar esta acción."
},
"status": "FAIL"
}Autorizaciones
Sesión por cookie de POST /v1/login, válida 1 hora. Ver Autenticación.
Parámetros de ruta
"219999990008"
Respuesta
É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ó.
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