curl --request POST \
--url https://api.wondeya.com/v1/pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"agentId": "<string>",
"body": {
"es": "<string>",
"en": "<string>"
},
"path": "<string>",
"projectId": "<string>"
}
'import requests
url = "https://api.wondeya.com/v1/pages"
payload = {
"name": "<string>",
"agentId": "<string>",
"body": {
"es": "<string>",
"en": "<string>"
},
"path": "<string>",
"projectId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
agentId: '<string>',
body: JSON.stringify({es: '<string>', en: '<string>'}),
path: '<string>',
projectId: '<string>'
})
};
fetch('https://api.wondeya.com/v1/pages', 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.wondeya.com/v1/pages",
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' => '<string>',
'agentId' => '<string>',
'body' => [
'es' => '<string>',
'en' => '<string>'
],
'path' => '<string>',
'projectId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.wondeya.com/v1/pages"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"body\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"projectId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.wondeya.com/v1/pages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"body\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"projectId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"body\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"projectId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"kind": "agent",
"path": "<string>",
"status": "<string>",
"defaultLocale": "es",
"editorial": {
"badge": {
"es": "<string>",
"en": "<string>"
},
"title": {
"es": "<string>",
"en": "<string>"
},
"titleAccent": {
"es": "<string>",
"en": "<string>"
},
"description": {
"es": "<string>",
"en": "<string>"
}
},
"seo": {
"title": {
"es": "<string>",
"en": "<string>"
},
"description": {
"es": "<string>",
"en": "<string>"
}
},
"sitemap": {
"priority": 0.5,
"changefreq": "always",
"sitemapExclude": true
},
"body": {
"es": "<string>",
"en": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"agentId": "<string>",
"projectId": "<string>",
"publishedAt": "2023-11-07T05:31:56Z"
}Crea una página
Nace como BORRADOR: no le responde a nadie hasta POST :id/publish. Una página agent (por defecto) necesita un agente; una página document (D-47) renderiza un cuerpo markdown subido.
curl --request POST \
--url https://api.wondeya.com/v1/pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"agentId": "<string>",
"body": {
"es": "<string>",
"en": "<string>"
},
"path": "<string>",
"projectId": "<string>"
}
'import requests
url = "https://api.wondeya.com/v1/pages"
payload = {
"name": "<string>",
"agentId": "<string>",
"body": {
"es": "<string>",
"en": "<string>"
},
"path": "<string>",
"projectId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
agentId: '<string>',
body: JSON.stringify({es: '<string>', en: '<string>'}),
path: '<string>',
projectId: '<string>'
})
};
fetch('https://api.wondeya.com/v1/pages', 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.wondeya.com/v1/pages",
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' => '<string>',
'agentId' => '<string>',
'body' => [
'es' => '<string>',
'en' => '<string>'
],
'path' => '<string>',
'projectId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.wondeya.com/v1/pages"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"body\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"projectId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.wondeya.com/v1/pages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"body\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"projectId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"agentId\": \"<string>\",\n \"body\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"path\": \"<string>\",\n \"projectId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"kind": "agent",
"path": "<string>",
"status": "<string>",
"defaultLocale": "es",
"editorial": {
"badge": {
"es": "<string>",
"en": "<string>"
},
"title": {
"es": "<string>",
"en": "<string>"
},
"titleAccent": {
"es": "<string>",
"en": "<string>"
},
"description": {
"es": "<string>",
"en": "<string>"
}
},
"seo": {
"title": {
"es": "<string>",
"en": "<string>"
},
"description": {
"es": "<string>",
"en": "<string>"
}
},
"sitemap": {
"priority": 0.5,
"changefreq": "always",
"sitemapExclude": true
},
"body": {
"es": "<string>",
"en": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"agentId": "<string>",
"projectId": "<string>",
"publishedAt": "2023-11-07T05:31:56Z"
}Autorizaciones
Una clave de API del espacio de trabajo: wdy_live_… / wdy_test_…. Se crea en POST /workspaces/{tenantId}/keys y se muestra exactamente una vez.
Cuerpo
Opcional al crear (C10): una página puede nacer como un borrador mínimo solo a partir de su tipo y nombrarse en su pantalla de ajustes. Publicar no requiere un nombre; la consola muestra un placeholder para un borrador sin nombre.
80Qué es la página (D-47). agent (por defecto) es una página conversacional con un agente y contenido editorial; document renderiza un body markdown subido y no admite agente ni contenido editorial.
agent, document El agente que responde en esta página. Opcional: un borrador puede dejarlo sin definir (se asigna automáticamente cuando el espacio de trabajo tiene exactamente un agente), pero publicar una página agent requiere uno. Una página document no tiene ninguno.
El markdown de una página document (D-47), por idioma. Opcional al crear (un borrador de documento puede empezar vacío; publicar requiere el idioma fuente); ausente para una página agent.
Show child attributes
Show child attributes
La dirección bajo el host del espacio de trabajo. / es la página principal, y exactamente una página por espacio de trabajo la tiene. De lo contrario, hasta 4 segmentos de letras, dígitos y guiones simples (/pymes, /enterprise/latam). No distingue mayúsculas de minúsculas y se almacena en minúsculas. Nunca codificada en porcentaje, nunca un segmento de punto. Reservados por la plataforma (y todo su subárbol): admin, api, app, cdn, console, docs, embed, mail, status, storage, well-known, widget, www. Su valor predeterminado es / cuando aún nada sirve la página principal, y de lo contrario una ruta derivada del nombre.
200El idioma en el que el propietario escribe esta página (D-44). Debe ser uno que el SITIO sirva; por defecto es el idioma de origen del proyecto. Qué idiomas se SIRVEN es una configuración del proyecto.
es, en El sitio (proyecto) dentro del cual se crea esta página. Opcional solo mientras el espacio de trabajo tenga exactamente uno; obligatorio con varios.
Respuesta
agent o document (D-47).
agent, document La dirección bajo el host del sitio. / es la página principal.
draft o published.
es, en El encuadre escrito por el dueño (página de agente). Vacío para un documento.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
El markdown de una página de documento. Vacío para una página de agente.
Show child attributes
Show child attributes
El cerebro que responde aquí. Ausente para una página de documento.
El sitio (proyecto) en el que vive la página.