curl --request POST \
--url https://api.gotrebol.com/v2/form-schemas \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Formulario de Onboarding",
"id_schema": "onboarding-form",
"ui_schema_definition": {
"ui_order": [
"junta_directiva",
"nombre",
"apellido",
"notaria"
],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"apellido": {
"ui_type": "text",
"ui_label": "Apellido"
},
"junta_directiva": {
"ui_type": "table",
"ui_label": "Integrantes miembros de la junta directiva",
"ui_columns": {
"id_type": {
"ui_type": "select",
"ui_label": "ID",
"ui_items": [
"RFC",
"CURP"
]
},
"id_number": {
"ui_type": "text",
"ui_label": "No. de identificación"
},
"names": {
"ui_type": "text",
"ui_label": "Nombres y Apellidos"
}
}
},
"notaria": {
"ui_type": "section",
"ui_label": "Notaria",
"ui_order": [
"nombre",
"direccion",
"identidad"
],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"direccion": {
"ui_type": "text",
"ui_label": "Direccion"
},
"identidad": {
"ui_type": "section",
"ui_label": "Identidad",
"ui_order": [
"curp",
"rfc"
],
"curp": {
"ui_type": "text",
"ui_label": "CURP"
},
"rfc": {
"ui_type": "text",
"ui_label": "RFC"
}
}
}
}
}
'import requests
url = "https://api.gotrebol.com/v2/form-schemas"
payload = {
"name": "Formulario de Onboarding",
"id_schema": "onboarding-form",
"ui_schema_definition": {
"ui_order": ["junta_directiva", "nombre", "apellido", "notaria"],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"apellido": {
"ui_type": "text",
"ui_label": "Apellido"
},
"junta_directiva": {
"ui_type": "table",
"ui_label": "Integrantes miembros de la junta directiva",
"ui_columns": {
"id_type": {
"ui_type": "select",
"ui_label": "ID",
"ui_items": ["RFC", "CURP"]
},
"id_number": {
"ui_type": "text",
"ui_label": "No. de identificación"
},
"names": {
"ui_type": "text",
"ui_label": "Nombres y Apellidos"
}
}
},
"notaria": {
"ui_type": "section",
"ui_label": "Notaria",
"ui_order": ["nombre", "direccion", "identidad"],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"direccion": {
"ui_type": "text",
"ui_label": "Direccion"
},
"identidad": {
"ui_type": "section",
"ui_label": "Identidad",
"ui_order": ["curp", "rfc"],
"curp": {
"ui_type": "text",
"ui_label": "CURP"
},
"rfc": {
"ui_type": "text",
"ui_label": "RFC"
}
}
}
}
}
headers = {
"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-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Formulario de Onboarding',
id_schema: 'onboarding-form',
ui_schema_definition: {
ui_order: ['junta_directiva', 'nombre', 'apellido', 'notaria'],
nombre: {ui_type: 'text', ui_label: 'Nombre'},
apellido: {ui_type: 'text', ui_label: 'Apellido'},
junta_directiva: {
ui_type: 'table',
ui_label: 'Integrantes miembros de la junta directiva',
ui_columns: {
id_type: {ui_type: 'select', ui_label: 'ID', ui_items: ['RFC', 'CURP']},
id_number: {ui_type: 'text', ui_label: 'No. de identificación'},
names: {ui_type: 'text', ui_label: 'Nombres y Apellidos'}
}
},
notaria: {
ui_type: 'section',
ui_label: 'Notaria',
ui_order: ['nombre', 'direccion', 'identidad'],
nombre: {ui_type: 'text', ui_label: 'Nombre'},
direccion: {ui_type: 'text', ui_label: 'Direccion'},
identidad: {
ui_type: 'section',
ui_label: 'Identidad',
ui_order: ['curp', 'rfc'],
curp: {ui_type: 'text', ui_label: 'CURP'},
rfc: {ui_type: 'text', ui_label: 'RFC'}
}
}
}
})
};
fetch('https://api.gotrebol.com/v2/form-schemas', 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.gotrebol.com/v2/form-schemas",
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([
'name' => 'Formulario de Onboarding',
'id_schema' => 'onboarding-form',
'ui_schema_definition' => [
'ui_order' => [
'junta_directiva',
'nombre',
'apellido',
'notaria'
],
'nombre' => [
'ui_type' => 'text',
'ui_label' => 'Nombre'
],
'apellido' => [
'ui_type' => 'text',
'ui_label' => 'Apellido'
],
'junta_directiva' => [
'ui_type' => 'table',
'ui_label' => 'Integrantes miembros de la junta directiva',
'ui_columns' => [
'id_type' => [
'ui_type' => 'select',
'ui_label' => 'ID',
'ui_items' => [
'RFC',
'CURP'
]
],
'id_number' => [
'ui_type' => 'text',
'ui_label' => 'No. de identificación'
],
'names' => [
'ui_type' => 'text',
'ui_label' => 'Nombres y Apellidos'
]
]
],
'notaria' => [
'ui_type' => 'section',
'ui_label' => 'Notaria',
'ui_order' => [
'nombre',
'direccion',
'identidad'
],
'nombre' => [
'ui_type' => 'text',
'ui_label' => 'Nombre'
],
'direccion' => [
'ui_type' => 'text',
'ui_label' => 'Direccion'
],
'identidad' => [
'ui_type' => 'section',
'ui_label' => 'Identidad',
'ui_order' => [
'curp',
'rfc'
],
'curp' => [
'ui_type' => 'text',
'ui_label' => 'CURP'
],
'rfc' => [
'ui_type' => 'text',
'ui_label' => 'RFC'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.gotrebol.com/v2/form-schemas"
payload := strings.NewReader("{\n \"name\": \"Formulario de Onboarding\",\n \"id_schema\": \"onboarding-form\",\n \"ui_schema_definition\": {\n \"ui_order\": [\n \"junta_directiva\",\n \"nombre\",\n \"apellido\",\n \"notaria\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"apellido\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Apellido\"\n },\n \"junta_directiva\": {\n \"ui_type\": \"table\",\n \"ui_label\": \"Integrantes miembros de la junta directiva\",\n \"ui_columns\": {\n \"id_type\": {\n \"ui_type\": \"select\",\n \"ui_label\": \"ID\",\n \"ui_items\": [\n \"RFC\",\n \"CURP\"\n ]\n },\n \"id_number\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"No. de identificación\"\n },\n \"names\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombres y Apellidos\"\n }\n }\n },\n \"notaria\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Notaria\",\n \"ui_order\": [\n \"nombre\",\n \"direccion\",\n \"identidad\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"direccion\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Direccion\"\n },\n \"identidad\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Identidad\",\n \"ui_order\": [\n \"curp\",\n \"rfc\"\n ],\n \"curp\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"CURP\"\n },\n \"rfc\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"RFC\"\n }\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.gotrebol.com/v2/form-schemas")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Formulario de Onboarding\",\n \"id_schema\": \"onboarding-form\",\n \"ui_schema_definition\": {\n \"ui_order\": [\n \"junta_directiva\",\n \"nombre\",\n \"apellido\",\n \"notaria\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"apellido\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Apellido\"\n },\n \"junta_directiva\": {\n \"ui_type\": \"table\",\n \"ui_label\": \"Integrantes miembros de la junta directiva\",\n \"ui_columns\": {\n \"id_type\": {\n \"ui_type\": \"select\",\n \"ui_label\": \"ID\",\n \"ui_items\": [\n \"RFC\",\n \"CURP\"\n ]\n },\n \"id_number\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"No. de identificación\"\n },\n \"names\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombres y Apellidos\"\n }\n }\n },\n \"notaria\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Notaria\",\n \"ui_order\": [\n \"nombre\",\n \"direccion\",\n \"identidad\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"direccion\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Direccion\"\n },\n \"identidad\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Identidad\",\n \"ui_order\": [\n \"curp\",\n \"rfc\"\n ],\n \"curp\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"CURP\"\n },\n \"rfc\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"RFC\"\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gotrebol.com/v2/form-schemas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Formulario de Onboarding\",\n \"id_schema\": \"onboarding-form\",\n \"ui_schema_definition\": {\n \"ui_order\": [\n \"junta_directiva\",\n \"nombre\",\n \"apellido\",\n \"notaria\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"apellido\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Apellido\"\n },\n \"junta_directiva\": {\n \"ui_type\": \"table\",\n \"ui_label\": \"Integrantes miembros de la junta directiva\",\n \"ui_columns\": {\n \"id_type\": {\n \"ui_type\": \"select\",\n \"ui_label\": \"ID\",\n \"ui_items\": [\n \"RFC\",\n \"CURP\"\n ]\n },\n \"id_number\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"No. de identificación\"\n },\n \"names\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombres y Apellidos\"\n }\n }\n },\n \"notaria\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Notaria\",\n \"ui_order\": [\n \"nombre\",\n \"direccion\",\n \"identidad\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"direccion\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Direccion\"\n },\n \"identidad\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Identidad\",\n \"ui_order\": [\n \"curp\",\n \"rfc\"\n ],\n \"curp\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"CURP\"\n },\n \"rfc\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"RFC\"\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id_schema": "onboarding-form",
"account_id": "acc_1234567890abcdef",
"name": "Formulario de Onboarding",
"ui_schema_definition": {
"ui_order": [
"junta_directiva",
"nombre",
"apellido",
"notaria"
],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"apellido": {
"ui_type": "text",
"ui_label": "Apellido"
},
"junta_directiva": {
"ui_type": "table",
"ui_label": "Integrantes miembros de la junta directiva",
"ui_columns": {
"id_type": {
"ui_type": "select",
"ui_label": "ID",
"ui_items": [
"RFC",
"CURP"
]
},
"id_number": {
"ui_type": "text",
"ui_label": "No. de identificación"
},
"names": {
"ui_type": "text",
"ui_label": "Nombres y Apellidos"
}
}
},
"notaria": {
"ui_type": "section",
"ui_label": "Notaria",
"ui_order": [
"nombre",
"direccion",
"identidad"
],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"direccion": {
"ui_type": "text",
"ui_label": "Direccion"
},
"identidad": {
"ui_type": "section",
"ui_label": "Identidad",
"ui_order": [
"curp",
"rfc"
],
"curp": {
"ui_type": "text",
"ui_label": "CURP"
},
"rfc": {
"ui_type": "text",
"ui_label": "RFC"
}
}
}
}
}Crear nuevo esquema de formulario
Crea un nuevo esquema de formulario para la cuenta.
Nota: El cuerpo de la solicitud está limitado a 200 KB por nuestro WAF. Si tu esquema (campos,
ui_label,description, validaciones, etc.) supera este tamaño, la solicitud será rechazada antes de llegar al backend. Considera dividir formularios muy grandes en varios esquemas más pequeños.
curl --request POST \
--url https://api.gotrebol.com/v2/form-schemas \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Formulario de Onboarding",
"id_schema": "onboarding-form",
"ui_schema_definition": {
"ui_order": [
"junta_directiva",
"nombre",
"apellido",
"notaria"
],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"apellido": {
"ui_type": "text",
"ui_label": "Apellido"
},
"junta_directiva": {
"ui_type": "table",
"ui_label": "Integrantes miembros de la junta directiva",
"ui_columns": {
"id_type": {
"ui_type": "select",
"ui_label": "ID",
"ui_items": [
"RFC",
"CURP"
]
},
"id_number": {
"ui_type": "text",
"ui_label": "No. de identificación"
},
"names": {
"ui_type": "text",
"ui_label": "Nombres y Apellidos"
}
}
},
"notaria": {
"ui_type": "section",
"ui_label": "Notaria",
"ui_order": [
"nombre",
"direccion",
"identidad"
],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"direccion": {
"ui_type": "text",
"ui_label": "Direccion"
},
"identidad": {
"ui_type": "section",
"ui_label": "Identidad",
"ui_order": [
"curp",
"rfc"
],
"curp": {
"ui_type": "text",
"ui_label": "CURP"
},
"rfc": {
"ui_type": "text",
"ui_label": "RFC"
}
}
}
}
}
'import requests
url = "https://api.gotrebol.com/v2/form-schemas"
payload = {
"name": "Formulario de Onboarding",
"id_schema": "onboarding-form",
"ui_schema_definition": {
"ui_order": ["junta_directiva", "nombre", "apellido", "notaria"],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"apellido": {
"ui_type": "text",
"ui_label": "Apellido"
},
"junta_directiva": {
"ui_type": "table",
"ui_label": "Integrantes miembros de la junta directiva",
"ui_columns": {
"id_type": {
"ui_type": "select",
"ui_label": "ID",
"ui_items": ["RFC", "CURP"]
},
"id_number": {
"ui_type": "text",
"ui_label": "No. de identificación"
},
"names": {
"ui_type": "text",
"ui_label": "Nombres y Apellidos"
}
}
},
"notaria": {
"ui_type": "section",
"ui_label": "Notaria",
"ui_order": ["nombre", "direccion", "identidad"],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"direccion": {
"ui_type": "text",
"ui_label": "Direccion"
},
"identidad": {
"ui_type": "section",
"ui_label": "Identidad",
"ui_order": ["curp", "rfc"],
"curp": {
"ui_type": "text",
"ui_label": "CURP"
},
"rfc": {
"ui_type": "text",
"ui_label": "RFC"
}
}
}
}
}
headers = {
"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-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Formulario de Onboarding',
id_schema: 'onboarding-form',
ui_schema_definition: {
ui_order: ['junta_directiva', 'nombre', 'apellido', 'notaria'],
nombre: {ui_type: 'text', ui_label: 'Nombre'},
apellido: {ui_type: 'text', ui_label: 'Apellido'},
junta_directiva: {
ui_type: 'table',
ui_label: 'Integrantes miembros de la junta directiva',
ui_columns: {
id_type: {ui_type: 'select', ui_label: 'ID', ui_items: ['RFC', 'CURP']},
id_number: {ui_type: 'text', ui_label: 'No. de identificación'},
names: {ui_type: 'text', ui_label: 'Nombres y Apellidos'}
}
},
notaria: {
ui_type: 'section',
ui_label: 'Notaria',
ui_order: ['nombre', 'direccion', 'identidad'],
nombre: {ui_type: 'text', ui_label: 'Nombre'},
direccion: {ui_type: 'text', ui_label: 'Direccion'},
identidad: {
ui_type: 'section',
ui_label: 'Identidad',
ui_order: ['curp', 'rfc'],
curp: {ui_type: 'text', ui_label: 'CURP'},
rfc: {ui_type: 'text', ui_label: 'RFC'}
}
}
}
})
};
fetch('https://api.gotrebol.com/v2/form-schemas', 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.gotrebol.com/v2/form-schemas",
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([
'name' => 'Formulario de Onboarding',
'id_schema' => 'onboarding-form',
'ui_schema_definition' => [
'ui_order' => [
'junta_directiva',
'nombre',
'apellido',
'notaria'
],
'nombre' => [
'ui_type' => 'text',
'ui_label' => 'Nombre'
],
'apellido' => [
'ui_type' => 'text',
'ui_label' => 'Apellido'
],
'junta_directiva' => [
'ui_type' => 'table',
'ui_label' => 'Integrantes miembros de la junta directiva',
'ui_columns' => [
'id_type' => [
'ui_type' => 'select',
'ui_label' => 'ID',
'ui_items' => [
'RFC',
'CURP'
]
],
'id_number' => [
'ui_type' => 'text',
'ui_label' => 'No. de identificación'
],
'names' => [
'ui_type' => 'text',
'ui_label' => 'Nombres y Apellidos'
]
]
],
'notaria' => [
'ui_type' => 'section',
'ui_label' => 'Notaria',
'ui_order' => [
'nombre',
'direccion',
'identidad'
],
'nombre' => [
'ui_type' => 'text',
'ui_label' => 'Nombre'
],
'direccion' => [
'ui_type' => 'text',
'ui_label' => 'Direccion'
],
'identidad' => [
'ui_type' => 'section',
'ui_label' => 'Identidad',
'ui_order' => [
'curp',
'rfc'
],
'curp' => [
'ui_type' => 'text',
'ui_label' => 'CURP'
],
'rfc' => [
'ui_type' => 'text',
'ui_label' => 'RFC'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.gotrebol.com/v2/form-schemas"
payload := strings.NewReader("{\n \"name\": \"Formulario de Onboarding\",\n \"id_schema\": \"onboarding-form\",\n \"ui_schema_definition\": {\n \"ui_order\": [\n \"junta_directiva\",\n \"nombre\",\n \"apellido\",\n \"notaria\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"apellido\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Apellido\"\n },\n \"junta_directiva\": {\n \"ui_type\": \"table\",\n \"ui_label\": \"Integrantes miembros de la junta directiva\",\n \"ui_columns\": {\n \"id_type\": {\n \"ui_type\": \"select\",\n \"ui_label\": \"ID\",\n \"ui_items\": [\n \"RFC\",\n \"CURP\"\n ]\n },\n \"id_number\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"No. de identificación\"\n },\n \"names\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombres y Apellidos\"\n }\n }\n },\n \"notaria\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Notaria\",\n \"ui_order\": [\n \"nombre\",\n \"direccion\",\n \"identidad\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"direccion\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Direccion\"\n },\n \"identidad\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Identidad\",\n \"ui_order\": [\n \"curp\",\n \"rfc\"\n ],\n \"curp\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"CURP\"\n },\n \"rfc\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"RFC\"\n }\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.gotrebol.com/v2/form-schemas")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Formulario de Onboarding\",\n \"id_schema\": \"onboarding-form\",\n \"ui_schema_definition\": {\n \"ui_order\": [\n \"junta_directiva\",\n \"nombre\",\n \"apellido\",\n \"notaria\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"apellido\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Apellido\"\n },\n \"junta_directiva\": {\n \"ui_type\": \"table\",\n \"ui_label\": \"Integrantes miembros de la junta directiva\",\n \"ui_columns\": {\n \"id_type\": {\n \"ui_type\": \"select\",\n \"ui_label\": \"ID\",\n \"ui_items\": [\n \"RFC\",\n \"CURP\"\n ]\n },\n \"id_number\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"No. de identificación\"\n },\n \"names\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombres y Apellidos\"\n }\n }\n },\n \"notaria\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Notaria\",\n \"ui_order\": [\n \"nombre\",\n \"direccion\",\n \"identidad\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"direccion\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Direccion\"\n },\n \"identidad\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Identidad\",\n \"ui_order\": [\n \"curp\",\n \"rfc\"\n ],\n \"curp\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"CURP\"\n },\n \"rfc\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"RFC\"\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gotrebol.com/v2/form-schemas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Formulario de Onboarding\",\n \"id_schema\": \"onboarding-form\",\n \"ui_schema_definition\": {\n \"ui_order\": [\n \"junta_directiva\",\n \"nombre\",\n \"apellido\",\n \"notaria\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"apellido\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Apellido\"\n },\n \"junta_directiva\": {\n \"ui_type\": \"table\",\n \"ui_label\": \"Integrantes miembros de la junta directiva\",\n \"ui_columns\": {\n \"id_type\": {\n \"ui_type\": \"select\",\n \"ui_label\": \"ID\",\n \"ui_items\": [\n \"RFC\",\n \"CURP\"\n ]\n },\n \"id_number\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"No. de identificación\"\n },\n \"names\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombres y Apellidos\"\n }\n }\n },\n \"notaria\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Notaria\",\n \"ui_order\": [\n \"nombre\",\n \"direccion\",\n \"identidad\"\n ],\n \"nombre\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Nombre\"\n },\n \"direccion\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"Direccion\"\n },\n \"identidad\": {\n \"ui_type\": \"section\",\n \"ui_label\": \"Identidad\",\n \"ui_order\": [\n \"curp\",\n \"rfc\"\n ],\n \"curp\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"CURP\"\n },\n \"rfc\": {\n \"ui_type\": \"text\",\n \"ui_label\": \"RFC\"\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id_schema": "onboarding-form",
"account_id": "acc_1234567890abcdef",
"name": "Formulario de Onboarding",
"ui_schema_definition": {
"ui_order": [
"junta_directiva",
"nombre",
"apellido",
"notaria"
],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"apellido": {
"ui_type": "text",
"ui_label": "Apellido"
},
"junta_directiva": {
"ui_type": "table",
"ui_label": "Integrantes miembros de la junta directiva",
"ui_columns": {
"id_type": {
"ui_type": "select",
"ui_label": "ID",
"ui_items": [
"RFC",
"CURP"
]
},
"id_number": {
"ui_type": "text",
"ui_label": "No. de identificación"
},
"names": {
"ui_type": "text",
"ui_label": "Nombres y Apellidos"
}
}
},
"notaria": {
"ui_type": "section",
"ui_label": "Notaria",
"ui_order": [
"nombre",
"direccion",
"identidad"
],
"nombre": {
"ui_type": "text",
"ui_label": "Nombre"
},
"direccion": {
"ui_type": "text",
"ui_label": "Direccion"
},
"identidad": {
"ui_type": "section",
"ui_label": "Identidad",
"ui_order": [
"curp",
"rfc"
],
"curp": {
"ui_type": "text",
"ui_label": "CURP"
},
"rfc": {
"ui_type": "text",
"ui_label": "RFC"
}
}
}
}
}Authorizations
Body
Nombre del esquema de formulario
"Formulario de Onboarding"
Identificador único del esquema
"onboarding-form"
Definición de campo de esquema de interfaz de usuario. Esta estructura permite definir formularios dinámicos con campos anidados y diferentes tipos de entrada. El esquema soporta campos simples como texto, números, fechas, y campos complejos como secciones que pueden contener otros campos.
Estructura jerárquica: Los campos pueden anidarse usando el tipo "section", permitiendo crear formularios con múltiples niveles de organización.
Validación automática: El sistema valida automáticamente que todos los campos referenciados en ui_order existan como propiedades en el mismo nivel.
Show child attributes
Show child attributes
{
"ui_order": [
"junta_directiva",
"nombre",
"apellido",
"notaria"
],
"nombre": { "ui_type": "text", "ui_label": "Nombre" },
"apellido": { "ui_type": "text", "ui_label": "Apellido" },
"junta_directiva": {
"ui_type": "table",
"ui_label": "Integrantes miembros de la junta directiva",
"ui_columns": {
"id_type": {
"ui_type": "select",
"ui_label": "ID",
"ui_items": ["RFC", "CURP"]
},
"id_number": {
"ui_type": "text",
"ui_label": "No. de identificación"
},
"names": {
"ui_type": "text",
"ui_label": "Nombres y Apellidos"
}
}
},
"notaria": {
"ui_type": "section",
"ui_label": "Notaria",
"ui_order": ["nombre", "direccion", "identidad"],
"nombre": { "ui_type": "text", "ui_label": "Nombre" },
"direccion": {
"ui_type": "text",
"ui_label": "Direccion"
},
"identidad": {
"ui_type": "section",
"ui_label": "Identidad",
"ui_order": ["curp", "rfc"],
"curp": { "ui_type": "text", "ui_label": "CURP" },
"rfc": { "ui_type": "text", "ui_label": "RFC" }
}
}
}
Response
Esquema creado exitosamente
Esquema de formulario público para la cuenta
Identificador único del esquema
"onboarding-form"
ID de la cuenta a la que pertenece el esquema
"acc_1234567890abcdef"
Nombre del esquema de formulario
"Formulario de Onboarding"
Definición de campo de esquema de interfaz de usuario. Esta estructura permite definir formularios dinámicos con campos anidados y diferentes tipos de entrada. El esquema soporta campos simples como texto, números, fechas, y campos complejos como secciones que pueden contener otros campos.
Estructura jerárquica: Los campos pueden anidarse usando el tipo "section", permitiendo crear formularios con múltiples niveles de organización.
Validación automática: El sistema valida automáticamente que todos los campos referenciados en ui_order existan como propiedades en el mismo nivel.
Show child attributes
Show child attributes
{
"ui_order": [
"junta_directiva",
"nombre",
"apellido",
"notaria"
],
"nombre": { "ui_type": "text", "ui_label": "Nombre" },
"apellido": { "ui_type": "text", "ui_label": "Apellido" },
"junta_directiva": {
"ui_type": "table",
"ui_label": "Integrantes miembros de la junta directiva",
"ui_columns": {
"id_type": {
"ui_type": "select",
"ui_label": "ID",
"ui_items": ["RFC", "CURP"]
},
"id_number": {
"ui_type": "text",
"ui_label": "No. de identificación"
},
"names": {
"ui_type": "text",
"ui_label": "Nombres y Apellidos"
}
}
},
"notaria": {
"ui_type": "section",
"ui_label": "Notaria",
"ui_order": ["nombre", "direccion", "identidad"],
"nombre": { "ui_type": "text", "ui_label": "Nombre" },
"direccion": {
"ui_type": "text",
"ui_label": "Direccion"
},
"identidad": {
"ui_type": "section",
"ui_label": "Identidad",
"ui_order": ["curp", "rfc"],
"curp": { "ui_type": "text", "ui_label": "CURP" },
"rfc": { "ui_type": "text", "ui_label": "RFC" }
}
}
}
Was this page helpful?