Get webchat embed script
curl --request GET \
--url https://your-instance.example.com/api/webhook/webchat-scriptimport requests
url = "https://your-instance.example.com/api/webhook/webchat-script"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://your-instance.example.com/api/webhook/webchat-script', 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://your-instance.example.com/api/webhook/webchat-script",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://your-instance.example.com/api/webhook/webchat-script"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://your-instance.example.com/api/webhook/webchat-script")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/webhook/webchat-script")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"(function(){var w=window,d=document,c={webchatConfigId:\"64a1b2c3d4e5f60012345678\",primaryColor:\"#3B82F6\",position:\"bottom-right\",starterMessage:\"Hi! How can we help?\",apiBaseUrl:\"https://api.tetherai.ca\"};w.__TETHER_WEBCHAT__=c;var s=d.createElement(\"script\");s.src=c.apiBaseUrl+\"/static/webchat-runtime.js\";s.async=true;d.head.appendChild(s);})();"{
"error": "Webchat configuration not found"
}{
"error": "Webchat configuration not found"
}Webhooks
Get webchat embed script
Public endpoint returning the JavaScript webchat widget loader with the resolved configuration (colors, position, starter message, etc.) inlined. Used by the <script src="…webchat-script?webchatConfigId=…"> tag a customer pastes onto their site.
GET
/
api
/
webhook
/
webchat-script
Get webchat embed script
curl --request GET \
--url https://your-instance.example.com/api/webhook/webchat-scriptimport requests
url = "https://your-instance.example.com/api/webhook/webchat-script"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://your-instance.example.com/api/webhook/webchat-script', 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://your-instance.example.com/api/webhook/webchat-script",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://your-instance.example.com/api/webhook/webchat-script"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://your-instance.example.com/api/webhook/webchat-script")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/webhook/webchat-script")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"(function(){var w=window,d=document,c={webchatConfigId:\"64a1b2c3d4e5f60012345678\",primaryColor:\"#3B82F6\",position:\"bottom-right\",starterMessage:\"Hi! How can we help?\",apiBaseUrl:\"https://api.tetherai.ca\"};w.__TETHER_WEBCHAT__=c;var s=d.createElement(\"script\");s.src=c.apiBaseUrl+\"/static/webchat-runtime.js\";s.async=true;d.head.appendChild(s);})();"{
"error": "Webchat configuration not found"
}{
"error": "Webchat configuration not found"
}Query Parameters
Response
JavaScript embed script with the resolved webchat configuration inlined.
The response is of type string.
⌘I