curl --request POST \
--url https://api.upnify.com/integraciones/plantillas \
--header 'Accept: application/json' \
--header 'token: TOKEN-SESION-EJEMPLO' \
--header 'Content-Type: application/json' \
--data '{
"nombre": "Captación web",
"tipoIntegracion": 7,
"configuracion": "{\"nombre\": \"Formulario web\"}",
"compartidoCon": 0
}'async function ejecutar() {
const response = await fetch("https://api.upnify.com/integraciones/plantillas", {
method: "POST",
headers: {"Accept": "application/json", "token": "TOKEN-SESION-EJEMPLO", "Content-Type": "application/json"},
body: JSON.stringify({"nombre":"Captación web","tipoIntegracion":7,"configuracion":"{\"nombre\": \"Formulario web\"}","compartidoCon":0})
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const data = text ? JSON.parse(text) : null;
// Usa data en tu aplicación sin exponer tokens o datos personales.
console.log("Estado HTTP:", response.status);
}
ejecutar().catch(console.error);// Node.js 18 o posterior.
async function ejecutar() {
const response = await fetch("https://api.upnify.com/integraciones/plantillas", {
method: "POST",
headers: {"Accept": "application/json", "token": "TOKEN-SESION-EJEMPLO", "Content-Type": "application/json"},
body: JSON.stringify({"nombre":"Captación web","tipoIntegracion":7,"configuracion":"{\"nombre\": \"Formulario web\"}","compartidoCon":0})
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
const data = text ? JSON.parse(text) : null;
// Usa data en tu aplicación sin exponer tokens o datos personales.
console.log("Estado HTTP:", response.status);
}
ejecutar().catch(console.error);import json
import requests
response = requests.request(
"POST",
"https://api.upnify.com/integraciones/plantillas",
headers={'Accept': 'application/json', 'token': 'TOKEN-SESION-EJEMPLO', 'Content-Type': 'application/json'},
json=json.loads('{"nombre":"Captación web","tipoIntegracion":7,"configuracion":"{\\"nombre\\": \\"Formulario web\\"}","compartidoCon":0}'),
timeout=30,
)
response.raise_for_status()
data = response.json() if response.text else None
# Usa data en tu aplicación sin exponer tokens o datos personales.
print("Estado HTTP:", response.status_code)package main
import (
"fmt"
"io"
"net/http"
"time"
"strings"
)
func main() {
body := strings.NewReader(`{"nombre":"Captación web","tipoIntegracion":7,"configuracion":"{\"nombre\": \"Formulario web\"}","compartidoCon":0}`)
request, err := http.NewRequest("POST", "https://api.upnify.com/integraciones/plantillas", body)
if err != nil { panic(err) }
request.Header.Set("Accept", "application/json")
request.Header.Set("token", "TOKEN-SESION-EJEMPLO")
request.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil { panic(err) }
defer response.Body.Close()
data, err := io.ReadAll(response.Body)
if err != nil { panic(err) }
if response.StatusCode < 200 || response.StatusCode >= 300 {
panic(fmt.Sprintf("HTTP %d: %s", response.StatusCode, data))
}
fmt.Println("Estado HTTP:", response.StatusCode)
}using System;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.upnify.com/integraciones/plantillas");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("token", "TOKEN-SESION-EJEMPLO");
request.Content = new StringContent("{\"nombre\":\"Captación web\",\"tipoIntegracion\":7,\"configuracion\":\"{\\\"nombre\\\": \\\"Formulario web\\\"}\",\"compartidoCon\":0}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();
response.EnsureSuccessStatusCode();
Console.WriteLine($"Estado HTTP: {(int)response.StatusCode}");