curl --request POST \
--url https://api.wondeya.com/v1/offers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"agentId": {},
"price": {
"amount": 123
},
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": true,
"ctaLinkId": {},
"ctaLabel": {
"es": "<string>",
"en": "<string>"
}
}
'import requests
url = "https://api.wondeya.com/v1/offers"
payload = {
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"agentId": {},
"price": { "amount": 123 },
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": True,
"ctaLinkId": {},
"ctaLabel": {
"es": "<string>",
"en": "<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({
key: '<string>',
name: {es: '<string>', en: '<string>'},
description: '<string>',
agentId: {},
price: {amount: 123},
features: [{es: '<string>', en: '<string>'}],
highlight: true,
ctaLinkId: {},
ctaLabel: {es: '<string>', en: '<string>'}
})
};
fetch('https://api.wondeya.com/v1/offers', 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/offers",
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([
'key' => '<string>',
'name' => [
'es' => '<string>',
'en' => '<string>'
],
'description' => '<string>',
'agentId' => [
],
'price' => [
'amount' => 123
],
'features' => [
[
'es' => '<string>',
'en' => '<string>'
]
],
'highlight' => true,
'ctaLinkId' => [
],
'ctaLabel' => [
'es' => '<string>',
'en' => '<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/offers"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\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/offers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/offers")
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 \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agentId": {},
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": true,
"ctaLinkId": {},
"status": "active",
"createdAt": "<string>",
"updatedAt": "<string>",
"price": {
"amount": 123,
"currency": "USD",
"period": "month"
},
"ctaLabel": {
"es": "<string>",
"en": "<string>"
}
}Crear o reemplazar una oferta
Hace upsert por key. El agente nunca escribe un precio; vive aquí y el servidor lo formatea.
curl --request POST \
--url https://api.wondeya.com/v1/offers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"agentId": {},
"price": {
"amount": 123
},
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": true,
"ctaLinkId": {},
"ctaLabel": {
"es": "<string>",
"en": "<string>"
}
}
'import requests
url = "https://api.wondeya.com/v1/offers"
payload = {
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"agentId": {},
"price": { "amount": 123 },
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": True,
"ctaLinkId": {},
"ctaLabel": {
"es": "<string>",
"en": "<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({
key: '<string>',
name: {es: '<string>', en: '<string>'},
description: '<string>',
agentId: {},
price: {amount: 123},
features: [{es: '<string>', en: '<string>'}],
highlight: true,
ctaLinkId: {},
ctaLabel: {es: '<string>', en: '<string>'}
})
};
fetch('https://api.wondeya.com/v1/offers', 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/offers",
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([
'key' => '<string>',
'name' => [
'es' => '<string>',
'en' => '<string>'
],
'description' => '<string>',
'agentId' => [
],
'price' => [
'amount' => 123
],
'features' => [
[
'es' => '<string>',
'en' => '<string>'
]
],
'highlight' => true,
'ctaLinkId' => [
],
'ctaLabel' => [
'es' => '<string>',
'en' => '<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/offers"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\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/offers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/offers")
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 \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agentId": {},
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": true,
"ctaLinkId": {},
"status": "active",
"createdAt": "<string>",
"updatedAt": "<string>",
"price": {
"amount": 123,
"currency": "USD",
"period": "month"
},
"ctaLabel": {
"es": "<string>",
"en": "<string>"
}
}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
El id en kebab-case que emite el modelo.
Show child attributes
Show child attributes
EN INGLÉS, orientada al prompt: cuándo ofrecerla.
600El agente al que pertenece esta oferta; null = el pool del espacio de trabajo.
Idioma de las instrucciones proporcionadas. El valor predeterminado es inglés para clientes existentes.
es, en Show child attributes
Show child attributes
6Show child attributes
Show child attributes
Un id de link del agente, hacia donde lleva el botón.
Texto localizado del botón CTA. El idioma principal es obligatorio; las traducciones automáticas de otros idiomas pueden llegar después.
Show child attributes
Show child attributes
Respuesta
Show child attributes
Show child attributes
Show child attributes
Show child attributes
active, archived Show child attributes
Show child attributes
Show child attributes
Show child attributes