위젯
위젯 생성
draft 상태의 위젯을 생성합니다. public_id는 서버가 발급합니다. 본문의 status와 published_*는 무시됩니다.
POST
/
widgets
위젯 생성
curl --request POST \
--url https://client-api.tryvox.co/v3/widgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_version": "current"
},
"mode": "chat",
"callback_from_number": "<string>",
"callback_presentation_number": "<string>",
"allowed_domains": [
"<string>"
],
"rate_limit": {
"per_minute": 123
},
"branding": {
"title": "<string>",
"accent_color": "<string>",
"orb_colors": {
"primary": "<string>",
"secondary": "<string>"
},
"styles": {
"button_radius": 123,
"input_radius": 123,
"bubble_radius": 123
},
"logo_url": "<string>",
"popup_message": "<string>",
"popup_delay_seconds": 1,
"auto_open": true,
"suggested_replies": [
"<string>"
],
"disclaimer_text": "<string>",
"response_hint": "<string>",
"markdown": true,
"link_allowed_hosts": [
"<string>"
],
"transcript": true,
"fab_text": "<string>",
"white_label": true,
"dynamic_variables": {},
"terms_url": "<string>",
"callback_fields": [
{
"key": "<string>",
"label": "<string>",
"placeholder": "<string>",
"required": true,
"options": [
"<string>"
]
}
]
},
"initial_responder_type": "agent",
"allow_agent_response": true
}
'import requests
url = "https://client-api.tryvox.co/v3/widgets"
payload = {
"agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_version": "current"
},
"mode": "chat",
"callback_from_number": "<string>",
"callback_presentation_number": "<string>",
"allowed_domains": ["<string>"],
"rate_limit": { "per_minute": 123 },
"branding": {
"title": "<string>",
"accent_color": "<string>",
"orb_colors": {
"primary": "<string>",
"secondary": "<string>"
},
"styles": {
"button_radius": 123,
"input_radius": 123,
"bubble_radius": 123
},
"logo_url": "<string>",
"popup_message": "<string>",
"popup_delay_seconds": 1,
"auto_open": True,
"suggested_replies": ["<string>"],
"disclaimer_text": "<string>",
"response_hint": "<string>",
"markdown": True,
"link_allowed_hosts": ["<string>"],
"transcript": True,
"fab_text": "<string>",
"white_label": True,
"dynamic_variables": {},
"terms_url": "<string>",
"callback_fields": [
{
"key": "<string>",
"label": "<string>",
"placeholder": "<string>",
"required": True,
"options": ["<string>"]
}
]
},
"initial_responder_type": "agent",
"allow_agent_response": True
}
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({
agent: {agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', agent_version: 'current'},
mode: 'chat',
callback_from_number: '<string>',
callback_presentation_number: '<string>',
allowed_domains: ['<string>'],
rate_limit: {per_minute: 123},
branding: {
title: '<string>',
accent_color: '<string>',
orb_colors: {primary: '<string>', secondary: '<string>'},
styles: {button_radius: 123, input_radius: 123, bubble_radius: 123},
logo_url: '<string>',
popup_message: '<string>',
popup_delay_seconds: 1,
auto_open: true,
suggested_replies: ['<string>'],
disclaimer_text: '<string>',
response_hint: '<string>',
markdown: true,
link_allowed_hosts: ['<string>'],
transcript: true,
fab_text: '<string>',
white_label: true,
dynamic_variables: {},
terms_url: '<string>',
callback_fields: [
{
key: '<string>',
label: '<string>',
placeholder: '<string>',
required: true,
options: ['<string>']
}
]
},
initial_responder_type: 'agent',
allow_agent_response: true
})
};
fetch('https://client-api.tryvox.co/v3/widgets', 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://client-api.tryvox.co/v3/widgets",
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([
'agent' => [
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agent_version' => 'current'
],
'mode' => 'chat',
'callback_from_number' => '<string>',
'callback_presentation_number' => '<string>',
'allowed_domains' => [
'<string>'
],
'rate_limit' => [
'per_minute' => 123
],
'branding' => [
'title' => '<string>',
'accent_color' => '<string>',
'orb_colors' => [
'primary' => '<string>',
'secondary' => '<string>'
],
'styles' => [
'button_radius' => 123,
'input_radius' => 123,
'bubble_radius' => 123
],
'logo_url' => '<string>',
'popup_message' => '<string>',
'popup_delay_seconds' => 1,
'auto_open' => true,
'suggested_replies' => [
'<string>'
],
'disclaimer_text' => '<string>',
'response_hint' => '<string>',
'markdown' => true,
'link_allowed_hosts' => [
'<string>'
],
'transcript' => true,
'fab_text' => '<string>',
'white_label' => true,
'dynamic_variables' => [
],
'terms_url' => '<string>',
'callback_fields' => [
[
'key' => '<string>',
'label' => '<string>',
'placeholder' => '<string>',
'required' => true,
'options' => [
'<string>'
]
]
]
],
'initial_responder_type' => 'agent',
'allow_agent_response' => true
]),
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://client-api.tryvox.co/v3/widgets"
payload := strings.NewReader("{\n \"agent\": {\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_version\": \"current\"\n },\n \"mode\": \"chat\",\n \"callback_from_number\": \"<string>\",\n \"callback_presentation_number\": \"<string>\",\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"rate_limit\": {\n \"per_minute\": 123\n },\n \"branding\": {\n \"title\": \"<string>\",\n \"accent_color\": \"<string>\",\n \"orb_colors\": {\n \"primary\": \"<string>\",\n \"secondary\": \"<string>\"\n },\n \"styles\": {\n \"button_radius\": 123,\n \"input_radius\": 123,\n \"bubble_radius\": 123\n },\n \"logo_url\": \"<string>\",\n \"popup_message\": \"<string>\",\n \"popup_delay_seconds\": 1,\n \"auto_open\": true,\n \"suggested_replies\": [\n \"<string>\"\n ],\n \"disclaimer_text\": \"<string>\",\n \"response_hint\": \"<string>\",\n \"markdown\": true,\n \"link_allowed_hosts\": [\n \"<string>\"\n ],\n \"transcript\": true,\n \"fab_text\": \"<string>\",\n \"white_label\": true,\n \"dynamic_variables\": {},\n \"terms_url\": \"<string>\",\n \"callback_fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"required\": true,\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"initial_responder_type\": \"agent\",\n \"allow_agent_response\": true\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://client-api.tryvox.co/v3/widgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": {\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_version\": \"current\"\n },\n \"mode\": \"chat\",\n \"callback_from_number\": \"<string>\",\n \"callback_presentation_number\": \"<string>\",\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"rate_limit\": {\n \"per_minute\": 123\n },\n \"branding\": {\n \"title\": \"<string>\",\n \"accent_color\": \"<string>\",\n \"orb_colors\": {\n \"primary\": \"<string>\",\n \"secondary\": \"<string>\"\n },\n \"styles\": {\n \"button_radius\": 123,\n \"input_radius\": 123,\n \"bubble_radius\": 123\n },\n \"logo_url\": \"<string>\",\n \"popup_message\": \"<string>\",\n \"popup_delay_seconds\": 1,\n \"auto_open\": true,\n \"suggested_replies\": [\n \"<string>\"\n ],\n \"disclaimer_text\": \"<string>\",\n \"response_hint\": \"<string>\",\n \"markdown\": true,\n \"link_allowed_hosts\": [\n \"<string>\"\n ],\n \"transcript\": true,\n \"fab_text\": \"<string>\",\n \"white_label\": true,\n \"dynamic_variables\": {},\n \"terms_url\": \"<string>\",\n \"callback_fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"required\": true,\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"initial_responder_type\": \"agent\",\n \"allow_agent_response\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-api.tryvox.co/v3/widgets")
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 \"agent\": {\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_version\": \"current\"\n },\n \"mode\": \"chat\",\n \"callback_from_number\": \"<string>\",\n \"callback_presentation_number\": \"<string>\",\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"rate_limit\": {\n \"per_minute\": 123\n },\n \"branding\": {\n \"title\": \"<string>\",\n \"accent_color\": \"<string>\",\n \"orb_colors\": {\n \"primary\": \"<string>\",\n \"secondary\": \"<string>\"\n },\n \"styles\": {\n \"button_radius\": 123,\n \"input_radius\": 123,\n \"bubble_radius\": 123\n },\n \"logo_url\": \"<string>\",\n \"popup_message\": \"<string>\",\n \"popup_delay_seconds\": 1,\n \"auto_open\": true,\n \"suggested_replies\": [\n \"<string>\"\n ],\n \"disclaimer_text\": \"<string>\",\n \"response_hint\": \"<string>\",\n \"markdown\": true,\n \"link_allowed_hosts\": [\n \"<string>\"\n ],\n \"transcript\": true,\n \"fab_text\": \"<string>\",\n \"white_label\": true,\n \"dynamic_variables\": {},\n \"terms_url\": \"<string>\",\n \"callback_fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"required\": true,\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"initial_responder_type\": \"agent\",\n \"allow_agent_response\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"public_id": "<string>",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_version": "current"
},
"status": "draft",
"mode": "chat",
"callback_from_number": "<string>",
"callback_presentation_number": "<string>",
"allowed_domains": [
"<string>"
],
"rate_limit": {
"preset": "standard",
"per_minute": 123
},
"branding": {
"title": "<string>",
"accent_color": "<string>",
"orb_colors": {
"primary": "<string>",
"secondary": "<string>"
},
"styles": {
"button_radius": 123,
"input_radius": 123,
"bubble_radius": 123
},
"theme": "light",
"logo_url": "<string>",
"popup_message": "<string>",
"popup_delay_seconds": 123,
"auto_open": true,
"suggested_replies": [
"<string>"
],
"disclaimer_text": "<string>",
"response_hint": "<string>",
"markdown": true,
"link_allowed_hosts": [
"<string>"
],
"transcript": true,
"fab_text": "<string>",
"placement": "bottom-right",
"panel_size": "compact",
"white_label": true,
"dynamic_variables": {},
"terms_url": "<string>",
"callback_fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"placeholder": "<string>",
"required": true,
"options": [
"<string>"
]
}
]
},
"published_at": 123,
"published_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": 123,
"updated_at": 123,
"initial_responder_type": "agent",
"allow_agent_response": true
}Authorizations
Body
application/json
생성할 위젯입니다.
이 위젯에서 시작되는 새 채팅의 첫 응답 담당입니다. agent(AI 에이전트) 또는 operator(상담사)를 지정합니다. chat 모드에만 적용되며 기존 채팅의 응답 담당은 유지됩니다. 실시간 설정이므로 다시 발행하지 않아도 새 채팅에 바로 적용되며, 발행해도 덮어쓰지 않습니다. null은 허용되지 않습니다. allow_agent_response=false는 agent와 함께 사용할 수 없습니다(400 AGENT_RESPONSE_NOT_ALLOWED). 기본값은 agent입니다.
Available options:
agent, operator 이 위젯의 채팅에 AI가 응답할 수 있는지 여부입니다. false이면 어떤 채팅도 AI로 시작하거나 AI 응대로 복귀하지 않으며, AI가 이미 응대 중인 채팅은 응답 담당을 유지하지만 이후 방문자 메시지에는 AI가 응답하지 않습니다. 메시지는 보관되며 사람이 계속 응답할 수 있습니다. 실시간 설정이므로 다시 발행하지 않아도 새 채팅에 적용되며, 발행해도 덮어쓰지 않습니다. null은 허용하지 않습니다. 저장된 값과 병합한 결과가 false이면 initial_responder_type이 operator여야 하며, 맞지 않으면 400 AGENT_RESPONSE_NOT_ALLOWED를 반환합니다. 기본값은 true입니다.
Response
성공 응답
Was this page helpful?
⌘I
위젯 생성
curl --request POST \
--url https://client-api.tryvox.co/v3/widgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_version": "current"
},
"mode": "chat",
"callback_from_number": "<string>",
"callback_presentation_number": "<string>",
"allowed_domains": [
"<string>"
],
"rate_limit": {
"per_minute": 123
},
"branding": {
"title": "<string>",
"accent_color": "<string>",
"orb_colors": {
"primary": "<string>",
"secondary": "<string>"
},
"styles": {
"button_radius": 123,
"input_radius": 123,
"bubble_radius": 123
},
"logo_url": "<string>",
"popup_message": "<string>",
"popup_delay_seconds": 1,
"auto_open": true,
"suggested_replies": [
"<string>"
],
"disclaimer_text": "<string>",
"response_hint": "<string>",
"markdown": true,
"link_allowed_hosts": [
"<string>"
],
"transcript": true,
"fab_text": "<string>",
"white_label": true,
"dynamic_variables": {},
"terms_url": "<string>",
"callback_fields": [
{
"key": "<string>",
"label": "<string>",
"placeholder": "<string>",
"required": true,
"options": [
"<string>"
]
}
]
},
"initial_responder_type": "agent",
"allow_agent_response": true
}
'import requests
url = "https://client-api.tryvox.co/v3/widgets"
payload = {
"agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_version": "current"
},
"mode": "chat",
"callback_from_number": "<string>",
"callback_presentation_number": "<string>",
"allowed_domains": ["<string>"],
"rate_limit": { "per_minute": 123 },
"branding": {
"title": "<string>",
"accent_color": "<string>",
"orb_colors": {
"primary": "<string>",
"secondary": "<string>"
},
"styles": {
"button_radius": 123,
"input_radius": 123,
"bubble_radius": 123
},
"logo_url": "<string>",
"popup_message": "<string>",
"popup_delay_seconds": 1,
"auto_open": True,
"suggested_replies": ["<string>"],
"disclaimer_text": "<string>",
"response_hint": "<string>",
"markdown": True,
"link_allowed_hosts": ["<string>"],
"transcript": True,
"fab_text": "<string>",
"white_label": True,
"dynamic_variables": {},
"terms_url": "<string>",
"callback_fields": [
{
"key": "<string>",
"label": "<string>",
"placeholder": "<string>",
"required": True,
"options": ["<string>"]
}
]
},
"initial_responder_type": "agent",
"allow_agent_response": True
}
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({
agent: {agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', agent_version: 'current'},
mode: 'chat',
callback_from_number: '<string>',
callback_presentation_number: '<string>',
allowed_domains: ['<string>'],
rate_limit: {per_minute: 123},
branding: {
title: '<string>',
accent_color: '<string>',
orb_colors: {primary: '<string>', secondary: '<string>'},
styles: {button_radius: 123, input_radius: 123, bubble_radius: 123},
logo_url: '<string>',
popup_message: '<string>',
popup_delay_seconds: 1,
auto_open: true,
suggested_replies: ['<string>'],
disclaimer_text: '<string>',
response_hint: '<string>',
markdown: true,
link_allowed_hosts: ['<string>'],
transcript: true,
fab_text: '<string>',
white_label: true,
dynamic_variables: {},
terms_url: '<string>',
callback_fields: [
{
key: '<string>',
label: '<string>',
placeholder: '<string>',
required: true,
options: ['<string>']
}
]
},
initial_responder_type: 'agent',
allow_agent_response: true
})
};
fetch('https://client-api.tryvox.co/v3/widgets', 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://client-api.tryvox.co/v3/widgets",
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([
'agent' => [
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agent_version' => 'current'
],
'mode' => 'chat',
'callback_from_number' => '<string>',
'callback_presentation_number' => '<string>',
'allowed_domains' => [
'<string>'
],
'rate_limit' => [
'per_minute' => 123
],
'branding' => [
'title' => '<string>',
'accent_color' => '<string>',
'orb_colors' => [
'primary' => '<string>',
'secondary' => '<string>'
],
'styles' => [
'button_radius' => 123,
'input_radius' => 123,
'bubble_radius' => 123
],
'logo_url' => '<string>',
'popup_message' => '<string>',
'popup_delay_seconds' => 1,
'auto_open' => true,
'suggested_replies' => [
'<string>'
],
'disclaimer_text' => '<string>',
'response_hint' => '<string>',
'markdown' => true,
'link_allowed_hosts' => [
'<string>'
],
'transcript' => true,
'fab_text' => '<string>',
'white_label' => true,
'dynamic_variables' => [
],
'terms_url' => '<string>',
'callback_fields' => [
[
'key' => '<string>',
'label' => '<string>',
'placeholder' => '<string>',
'required' => true,
'options' => [
'<string>'
]
]
]
],
'initial_responder_type' => 'agent',
'allow_agent_response' => true
]),
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://client-api.tryvox.co/v3/widgets"
payload := strings.NewReader("{\n \"agent\": {\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_version\": \"current\"\n },\n \"mode\": \"chat\",\n \"callback_from_number\": \"<string>\",\n \"callback_presentation_number\": \"<string>\",\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"rate_limit\": {\n \"per_minute\": 123\n },\n \"branding\": {\n \"title\": \"<string>\",\n \"accent_color\": \"<string>\",\n \"orb_colors\": {\n \"primary\": \"<string>\",\n \"secondary\": \"<string>\"\n },\n \"styles\": {\n \"button_radius\": 123,\n \"input_radius\": 123,\n \"bubble_radius\": 123\n },\n \"logo_url\": \"<string>\",\n \"popup_message\": \"<string>\",\n \"popup_delay_seconds\": 1,\n \"auto_open\": true,\n \"suggested_replies\": [\n \"<string>\"\n ],\n \"disclaimer_text\": \"<string>\",\n \"response_hint\": \"<string>\",\n \"markdown\": true,\n \"link_allowed_hosts\": [\n \"<string>\"\n ],\n \"transcript\": true,\n \"fab_text\": \"<string>\",\n \"white_label\": true,\n \"dynamic_variables\": {},\n \"terms_url\": \"<string>\",\n \"callback_fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"required\": true,\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"initial_responder_type\": \"agent\",\n \"allow_agent_response\": true\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://client-api.tryvox.co/v3/widgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": {\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_version\": \"current\"\n },\n \"mode\": \"chat\",\n \"callback_from_number\": \"<string>\",\n \"callback_presentation_number\": \"<string>\",\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"rate_limit\": {\n \"per_minute\": 123\n },\n \"branding\": {\n \"title\": \"<string>\",\n \"accent_color\": \"<string>\",\n \"orb_colors\": {\n \"primary\": \"<string>\",\n \"secondary\": \"<string>\"\n },\n \"styles\": {\n \"button_radius\": 123,\n \"input_radius\": 123,\n \"bubble_radius\": 123\n },\n \"logo_url\": \"<string>\",\n \"popup_message\": \"<string>\",\n \"popup_delay_seconds\": 1,\n \"auto_open\": true,\n \"suggested_replies\": [\n \"<string>\"\n ],\n \"disclaimer_text\": \"<string>\",\n \"response_hint\": \"<string>\",\n \"markdown\": true,\n \"link_allowed_hosts\": [\n \"<string>\"\n ],\n \"transcript\": true,\n \"fab_text\": \"<string>\",\n \"white_label\": true,\n \"dynamic_variables\": {},\n \"terms_url\": \"<string>\",\n \"callback_fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"required\": true,\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"initial_responder_type\": \"agent\",\n \"allow_agent_response\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-api.tryvox.co/v3/widgets")
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 \"agent\": {\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_version\": \"current\"\n },\n \"mode\": \"chat\",\n \"callback_from_number\": \"<string>\",\n \"callback_presentation_number\": \"<string>\",\n \"allowed_domains\": [\n \"<string>\"\n ],\n \"rate_limit\": {\n \"per_minute\": 123\n },\n \"branding\": {\n \"title\": \"<string>\",\n \"accent_color\": \"<string>\",\n \"orb_colors\": {\n \"primary\": \"<string>\",\n \"secondary\": \"<string>\"\n },\n \"styles\": {\n \"button_radius\": 123,\n \"input_radius\": 123,\n \"bubble_radius\": 123\n },\n \"logo_url\": \"<string>\",\n \"popup_message\": \"<string>\",\n \"popup_delay_seconds\": 1,\n \"auto_open\": true,\n \"suggested_replies\": [\n \"<string>\"\n ],\n \"disclaimer_text\": \"<string>\",\n \"response_hint\": \"<string>\",\n \"markdown\": true,\n \"link_allowed_hosts\": [\n \"<string>\"\n ],\n \"transcript\": true,\n \"fab_text\": \"<string>\",\n \"white_label\": true,\n \"dynamic_variables\": {},\n \"terms_url\": \"<string>\",\n \"callback_fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"required\": true,\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"initial_responder_type\": \"agent\",\n \"allow_agent_response\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"public_id": "<string>",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_version": "current"
},
"status": "draft",
"mode": "chat",
"callback_from_number": "<string>",
"callback_presentation_number": "<string>",
"allowed_domains": [
"<string>"
],
"rate_limit": {
"preset": "standard",
"per_minute": 123
},
"branding": {
"title": "<string>",
"accent_color": "<string>",
"orb_colors": {
"primary": "<string>",
"secondary": "<string>"
},
"styles": {
"button_radius": 123,
"input_radius": 123,
"bubble_radius": 123
},
"theme": "light",
"logo_url": "<string>",
"popup_message": "<string>",
"popup_delay_seconds": 123,
"auto_open": true,
"suggested_replies": [
"<string>"
],
"disclaimer_text": "<string>",
"response_hint": "<string>",
"markdown": true,
"link_allowed_hosts": [
"<string>"
],
"transcript": true,
"fab_text": "<string>",
"placement": "bottom-right",
"panel_size": "compact",
"white_label": true,
"dynamic_variables": {},
"terms_url": "<string>",
"callback_fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"placeholder": "<string>",
"required": true,
"options": [
"<string>"
]
}
]
},
"published_at": 123,
"published_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": 123,
"updated_at": 123,
"initial_responder_type": "agent",
"allow_agent_response": true
}