获取会话列表
curl --request GET \
--url https://{deployed_api_base_url}/v2/conversations \
--header 'Authorization: Bearer <token>'import requests
url = "https://{deployed_api_base_url}/v2/conversations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{deployed_api_base_url}/v2/conversations', 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://{deployed_api_base_url}/v2/conversations",
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://{deployed_api_base_url}/v2/conversations"
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://{deployed_api_base_url}/v2/conversations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{deployed_api_base_url}/v2/conversations")
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{
"limit": 20,
"has_more": false,
"data": [
{
"id": "0f8fad5b-d9cb-469f-a165-70867728950e",
"name": "Refund status inquiry",
"inputs": {
"order_id": "ORDER-1001"
},
"status": "normal",
"introduction": "Hello! I can help you check your orders.",
"created_at": 1787788800,
"updated_at": 1787788860
}
]
}部署环境
获取会话列表
GET
/
v2
/
conversations
获取会话列表
curl --request GET \
--url https://{deployed_api_base_url}/v2/conversations \
--header 'Authorization: Bearer <token>'import requests
url = "https://{deployed_api_base_url}/v2/conversations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{deployed_api_base_url}/v2/conversations', 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://{deployed_api_base_url}/v2/conversations",
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://{deployed_api_base_url}/v2/conversations"
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://{deployed_api_base_url}/v2/conversations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{deployed_api_base_url}/v2/conversations")
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{
"limit": 20,
"has_more": false,
"data": [
{
"id": "0f8fad5b-d9cb-469f-a165-70867728950e",
"name": "Refund status inquiry",
"inputs": {
"order_id": "ORDER-1001"
},
"status": "normal",
"introduction": "Hello! I can help you check your orders.",
"created_at": 1787788800,
"updated_at": 1787788860
}
]
}授权
查询参数
分页游标:当前页最后一个会话的 id。省略则获取第一页。
返回的记录数。
必填范围:
1 <= x <= 100排序字段。加 - 前缀表示降序。
可用选项:
created_at, -created_at, updated_at, -updated_at