1.2.2-Query Robot Conversation History List
1. Overview
Interface name: Get session history
Version number: v1.3.20
2. Information
Request method: POST
Request URL: https://DOMAIN/openapi/v1/conversation/segment/get_list/
Domain: Refer to "Service address description"
3. Request parameters
Request header http header field:
Content-Type
string
Yes
Fixedapplication/json
cybertron-robot-key
string
Yes
Robot key
cybertron-robot-token
string
Yes
Robot token
Request body field:
username
string
Yes
User account
filter_mode
int
Yes
0 filter but filter; 1 filter
filter_user_code
string
No
Required if filter user_code filter_mode is 1
create_start_time
string
No
Session start time, format must2024-10-01 00:00:00
create_end_time
string
No
Same as above
message_source
string
No
Source
segment_code_list
string
No
Session encoding list
page
int
No
Number of pages, default is 1
pagesize
int
No
The number of results returned per page, default is 10
4. Response field description
HTTP status code: 200 OK
Response field description:
code
string
"000000" is normal, other exceptions
message
string
Status description
data
array
message body
data.total
int
Total records
data.page
int
Current page number
data.page_size
int
Records per page
data.has_next
bool
Can I turn the page backwards
data.has_previous
bool
Can I turn the page forward
data.max_page_num
int
Total page count
data.list
array
content
data.list[].segment_code
string
session encoding
data.list[].user_code
string
User encoding
data.list[].create_time
string
creation time
data.list[].chat_count
string
conversations
data.list[].segment_name
string
conversation name
data.list[].message_source
string
dialog source
5. Example
Request Example:
curl 'https://_DOMAIN_/openapi/v1/conversation/segment/get_list/' \
-H 'Content-Type: application/json' \
-H 'cybertron-robot-key: l8ia2IOc************Z724%2BU%3D' \
-H 'cybertron-robot-token: MTc0Mzk5************************************************cGRCUTg9' \
-X POST -d '{
"username": "me@host.com",
"filter_mode": 0,
"filter_user_code": "",
"create_start_time": "",
"create_end_time": "",
"message_source": "",
"segment_code_list": [
"K8aV12v4IzPao1Y1jQ2pJ",
"B_dX0krj1fHRyzAOM5d0Z"
],
"page": 1,
"pagesize": 20
}'Response example:
{
"code": "000000",
"message": "ok",
"data": {
"total": 2,
"list": [
{
"chat_count": 28,
"segment_code": "K8aV12v4IzPao1Y1jQ2pJ",
"segment_name": "Hello",
"user_code": "me@host.com",
"create_time": "2024-12-16 17:22:08",
"message_source": "web"
},
{
"chat_count": 4,
"segment_code": "B_dX0krj1fHRyzAOM5d0Z",
"segment_name": "Ah haha",
"user_code": "me@host.com",
"create_time": "2024-12-18 15:43:42",
"message_source": "web"
}
],
"page": 1,
"page_size": 10,
"has_next": false,
"has_previous": false,
"max_page_num": 1
}
}