Resolve a hosted website widget
curl --request GET \
--url https://api.pyai.com/public/widgets/{publicId} \
--header 'Origin: <origin>'import requests
url = "https://api.pyai.com/public/widgets/{publicId}"
headers = {"Origin": "<origin>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Origin: '<origin>'}};
fetch('https://api.pyai.com/public/widgets/{publicId}', 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.pyai.com/public/widgets/{publicId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Origin: <origin>"
],
]);
$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://api.pyai.com/public/widgets/{publicId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Origin", "<origin>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pyai.com/public/widgets/{publicId}")
.header("Origin", "<origin>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/public/widgets/{publicId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Origin"] = '<origin>'
response = http.request(request)
puts response.read_body{}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Agents
Resolve a hosted website widget
Returns hosted runtime version 7, caller-only transcript capability, the published widget’s safe display configuration, and public profile. Agent text is not inferred from audio. Requires an exact Origin header match. The opaque public id does not expose the organization, project, Agent, or credentials.
GET
/
public
/
widgets
/
{publicId}
Resolve a hosted website widget
curl --request GET \
--url https://api.pyai.com/public/widgets/{publicId} \
--header 'Origin: <origin>'import requests
url = "https://api.pyai.com/public/widgets/{publicId}"
headers = {"Origin": "<origin>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Origin: '<origin>'}};
fetch('https://api.pyai.com/public/widgets/{publicId}', 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.pyai.com/public/widgets/{publicId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Origin: <origin>"
],
]);
$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://api.pyai.com/public/widgets/{publicId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Origin", "<origin>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pyai.com/public/widgets/{publicId}")
.header("Origin", "<origin>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/public/widgets/{publicId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Origin"] = '<origin>'
response = http.request(request)
puts response.read_body{}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}⌘I