위젯 게시
현재 편집 내용을 새 버전으로 저장하고 인증된 조직의 위젯을 게시합니다. 다시 게시하면 항상 새 버전이 추가됩니다.
curl --request POST \
--url https://client-api.tryvox.co/v3/widgets/{widget_id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://client-api.tryvox.co/v3/widgets/{widget_id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://client-api.tryvox.co/v3/widgets/{widget_id}/publish', 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/{widget_id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://client-api.tryvox.co/v3/widgets/{widget_id}/publish"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/{widget_id}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-api.tryvox.co/v3/widgets/{widget_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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>",
"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
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed.",
"details": {
"field": "name",
"reason": "must not be blank"
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication is required.",
"details": {}
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied.",
"details": {}
}
}{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found.",
"details": {
"resource": "agent"
}
}
}{
"error": {
"code": "CONFLICT",
"message": "The requested operation conflicts with current state.",
"details": {
"current_status": "draft"
}
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests.",
"details": {
"limit": 10,
"window_seconds": 1,
"scope": "user"
}
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error.",
"details": {}
}
}{
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "Service temporarily unavailable.",
"details": {}
}
}Authorizations
조직 API 키를 Authorization: Bearer <token> 형식으로 보냅니다.
Path Parameters
위젯 ID입니다. public_id가 아니라 GET /v3/widgets 응답의 id를 사용합니다.
Response
성공 응답
위젯 ID입니다. UUID이며 경로 파라미터 widget_id에 사용합니다.
설치 코드의 data-widget-id입니다. wgt_… 형식이며 서버가 발급하고 읽기 전용입니다.
위젯을 소유한 조직 ID입니다.
agent_id와 agent_version으로 구성된 에이전트 매핑 객체입니다.
Show child attributes
Show child attributes
위젯 상태입니다. draft, published, archived 중 하나이며 생성·수정 요청에서는 바꿀 수 없습니다.
draft, published, archived 위젯 유형입니다. chat, voice, callback 중 하나입니다.
chat, voice, callback 발신번호입니다. 없으면 null입니다.
수신자에게 표시할 번호입니다. null이면 callback_from_number가 표시됩니다.
설치를 허용한 도메인 목록입니다.
대화 시작 한도입니다. null이면 standard(방문자 IP당 분당 5회)를 적용합니다.
Show child attributes
Show child attributes
모양과 메시지 설정입니다. 설정하지 않은 키는 null입니다.
Show child attributes
Show child attributes
마지막 게시 시각입니다. unix milliseconds 형식입니다. 게시를 해제한 뒤에도 유지됩니다. 게시한 적이 없으면 null입니다.
마지막 게시 버전 ID입니다. 게시를 해제한 뒤에도 유지됩니다. 게시한 적이 없으면 null입니다.
리소스 생성 시각입니다. unix milliseconds 형식입니다.
리소스 마지막 수정 시각입니다. unix milliseconds 형식입니다.
Was this page helpful?
curl --request POST \
--url https://client-api.tryvox.co/v3/widgets/{widget_id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://client-api.tryvox.co/v3/widgets/{widget_id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://client-api.tryvox.co/v3/widgets/{widget_id}/publish', 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/{widget_id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://client-api.tryvox.co/v3/widgets/{widget_id}/publish"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/{widget_id}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-api.tryvox.co/v3/widgets/{widget_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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>",
"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
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed.",
"details": {
"field": "name",
"reason": "must not be blank"
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication is required.",
"details": {}
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied.",
"details": {}
}
}{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found.",
"details": {
"resource": "agent"
}
}
}{
"error": {
"code": "CONFLICT",
"message": "The requested operation conflicts with current state.",
"details": {
"current_status": "draft"
}
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests.",
"details": {
"limit": 10,
"window_seconds": 1,
"scope": "user"
}
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error.",
"details": {}
}
}{
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "Service temporarily unavailable.",
"details": {}
}
}