curl --request PATCH \
--url https://api.wondeya.com/v1/projects/{projectId}/theme \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"tokens": {}
}'import requests
url = "https://api.wondeya.com/v1/projects/{projectId}/theme"
payload = { "tokens": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({tokens: {}})
};
fetch('https://api.wondeya.com/v1/projects/{projectId}/theme', 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/projects/{projectId}/theme",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'tokens' => [
]
]),
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/projects/{projectId}/theme"
payload := strings.NewReader("{\n \"tokens\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.wondeya.com/v1/projects/{projectId}/theme")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tokens\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/projects/{projectId}/theme")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tokens\": {}\n}"
response = http.request(request)
puts response.read_body{
"tokens": {
"colors": {
"primary": "#6d28d9",
"accent": "#7c3aed",
"surface": "#ffffff",
"ink": "#171717",
"muted": "#737373"
},
"typography": {
"heading": "montserrat",
"body": "montserrat"
},
"radius": "none"
},
"cssVariables": {},
"customized": true,
"updatedAt": "2023-11-07T05:31:56Z"
}Establece el tema del sitio
Re-estiliza todo el sitio: tokens es un parche PARCIAL fusionado sobre el tema vigente; null restablece los valores por defecto de wondeya. Los colores son hex de 6 dígitos; las tipografías y los radios son claves del catálogo, y cualquier otra cosa es wondeya.theme.invalid.
curl --request PATCH \
--url https://api.wondeya.com/v1/projects/{projectId}/theme \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"tokens": {}
}'import requests
url = "https://api.wondeya.com/v1/projects/{projectId}/theme"
payload = { "tokens": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({tokens: {}})
};
fetch('https://api.wondeya.com/v1/projects/{projectId}/theme', 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/projects/{projectId}/theme",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'tokens' => [
]
]),
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/projects/{projectId}/theme"
payload := strings.NewReader("{\n \"tokens\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.wondeya.com/v1/projects/{projectId}/theme")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tokens\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/projects/{projectId}/theme")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tokens\": {}\n}"
response = http.request(request)
puts response.read_body{
"tokens": {
"colors": {
"primary": "#6d28d9",
"accent": "#7c3aed",
"surface": "#ffffff",
"ink": "#171717",
"muted": "#737373"
},
"typography": {
"heading": "montserrat",
"body": "montserrat"
},
"radius": "none"
},
"cssVariables": {},
"customized": true,
"updatedAt": "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.
Parámetros de ruta
Cuerpo
Un parche parcial de tokens (por ejemplo {"colors":{"primary":"#6d28d9"}}), o null para restablecer los valores por defecto de wondeya.
Respuesta
Los tokens vigentes.
Show child attributes
Show child attributes
Propiedades personalizadas de CSS listas para inyectar, todos los valores nuestros (D-9).
Show child attributes
Show child attributes
False mientras el sitio use los valores por defecto de wondeya.