数据分析
获取 AI 助手会话线程
返回单个 AI 助手会话线程的完整消息转录。线程 ID 可从 AI 助手会话端点获取,或作为 AI 助手链接转接支持 URL 上追加的 threadId 查询参数获取。
使用管理员 API 密钥进行身份验证。
GET
/
v1
/
analytics
/
{projectId}
/
assistant
/
threads
/
{threadId}
获取 AI 助手会话线程
curl --request GET \
--url https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}', 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.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}"
req, _ := http.NewRequest("GET", 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.get("https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"threadId": "<string>",
"createdAt": "<string>",
"messages": [
{
"id": "<string>",
"content": "<string>",
"createdAt": "<string>"
}
]
}{
"error": "<string>",
"details": [
{
"message": "<string>"
}
]
}{
"error": "<string>",
"details": [
{
"message": "<string>"
}
]
}{
"error": "<string>",
"details": [
{
"message": "<string>"
}
]
}用法
- 当用户从 AI 助手联系支持时,将会话转录附加到工单。
- 为审查、质量保证或离线分析重建特定会话。
获取 thread ID
threadId:
- 获取 AI 助手会话 返回的任一行的
id字段。 - 当 AI 助手通过链接转接将用户引导到你的支持平台时,Mintlify 追加到支持 URL 上的
threadId查询参数。
速率限制
此端点每个组织每小时允许 100 次请求。所有 analytics 端点共享此限制。授权
⌘I
获取 AI 助手会话线程
curl --request GET \
--url https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}', 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.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}"
req, _ := http.NewRequest("GET", 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.get("https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v1/analytics/{projectId}/assistant/threads/{threadId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"threadId": "<string>",
"createdAt": "<string>",
"messages": [
{
"id": "<string>",
"content": "<string>",
"createdAt": "<string>"
}
]
}{
"error": "<string>",
"details": [
{
"message": "<string>"
}
]
}{
"error": "<string>",
"details": [
{
"message": "<string>"
}
]
}{
"error": "<string>",
"details": [
{
"message": "<string>"
}
]
}