Crear Token de Acceso
curl --request POST \
--url https://api.zynvo.uy/v1/tokens \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Sandbox-Mode: <x-sandbox-mode>' \
--data '{}'import requests
url = "https://api.zynvo.uy/v1/tokens"
payload = {}
headers = {
"X-Sandbox-Mode": "<x-sandbox-mode>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Sandbox-Mode': '<x-sandbox-mode>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://api.zynvo.uy/v1/tokens', 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.zynvo.uy/v1/tokens",
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([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Sandbox-Mode: <x-sandbox-mode>"
],
]);
$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.zynvo.uy/v1/tokens"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Sandbox-Mode", "<x-sandbox-mode>")
req.Header.Add("X-API-Key", "<api-key>")
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.zynvo.uy/v1/tokens")
.header("X-Sandbox-Mode", "<x-sandbox-mode>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zynvo.uy/v1/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Sandbox-Mode"] = '<x-sandbox-mode>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ6eW52b19saXZlX2FiYzEyMyIsImlhdCI6MTY3NzY3MjAwMCwiZXhwIjoxNjc3Njc1NjAwfQ.abc123def456",
"token_type": "Bearer",
"expires_in": 3600
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Los datos proporcionados no son válidos"
}
}{
"error": {
"code": "INVALID_API_KEY",
"message": "La API Key proporcionada no es válida"
}
}Autenticación
Crear Token de Acceso
Crea un nuevo token JWT utilizando tu API Key proporcionada en el header X-API-Key. Este token debe ser utilizado en el header Authorization como Bearer token para el resto de endpoints junto con el X-API-Key.
POST
/
tokens
Crear Token de Acceso
curl --request POST \
--url https://api.zynvo.uy/v1/tokens \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Sandbox-Mode: <x-sandbox-mode>' \
--data '{}'import requests
url = "https://api.zynvo.uy/v1/tokens"
payload = {}
headers = {
"X-Sandbox-Mode": "<x-sandbox-mode>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Sandbox-Mode': '<x-sandbox-mode>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://api.zynvo.uy/v1/tokens', 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.zynvo.uy/v1/tokens",
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([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Sandbox-Mode: <x-sandbox-mode>"
],
]);
$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.zynvo.uy/v1/tokens"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Sandbox-Mode", "<x-sandbox-mode>")
req.Header.Add("X-API-Key", "<api-key>")
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.zynvo.uy/v1/tokens")
.header("X-Sandbox-Mode", "<x-sandbox-mode>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zynvo.uy/v1/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Sandbox-Mode"] = '<x-sandbox-mode>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ6eW52b19saXZlX2FiYzEyMyIsImlhdCI6MTY3NzY3MjAwMCwiZXhwIjoxNjc3Njc1NjAwfQ.abc123def456",
"token_type": "Bearer",
"expires_in": 3600
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Los datos proporcionados no son válidos"
}
}{
"error": {
"code": "INVALID_API_KEY",
"message": "La API Key proporcionada no es válida"
}
}Authorizations
API Key de Zynvo obtenida desde el dashboard. Requerida en todos los endpoints.
Headers
Define el entorno de ejecución de la API.
Valores:
"true"- Modo sandbox: Usa datos de prueba aislados"false"- Modo producción: Usa datos reales
Available options:
true, false Body
application/json
The body is of type object.
Response
Token generado exitosamente
Show child attributes
Show child attributes
⌘I