嵌入式组件
接管会话
将实时小组件对话交给人工客服接管,并暂停 AI 回复。
POST
/
api
/
v1
/
iframes
/
{id}
/
conversations
/
{sessionId}
/
takeover
接管会话
curl --request POST \
--url https://api.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeoverimport requests
url = "https://api.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover', 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.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"takeover_status": "<string>",
"taken_over_by": "<string>",
"taken_over_at": "<string>"
}将会话标记为人工驱动,使小组件停止生成 AI 回复。此操作具有幂等性——重复调用只会刷新接管时间戳。使用 Release 可将控制权交还。
身份验证
需要提供 Bearer 令牌(API 密钥)或仪表盘会话。路径参数
响应
示例
curl
curl -X POST https://www.hitheo.ai/api/v1/iframes/CONFIG_ID/conversations/SESSION_ID/takeover \
-H "Authorization: Bearer $THEO_API_KEY"
此页面对您有帮助吗?
接管会话
curl --request POST \
--url https://api.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeoverimport requests
url = "https://api.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover', 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.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/iframes/{id}/conversations/{sessionId}/takeover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"session_id": "<string>",
"takeover_status": "<string>",
"taken_over_by": "<string>",
"taken_over_at": "<string>"
}