嵌入式組件
接管會話
將實時小組件對話交給人工客服接管,並暫停 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 密鑰)或儀表盤會話。路徑參數
string
必填
小組件配置的 UUID。
string
必填
會話的 UUID。
響應
string
string
接管成功後為
"human"。string
接管操作員的用戶 ID。
string
接管發生時間的 ISO 時間戳。
示例
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>"
}