2.2.5-Get the directory tree under the knowledge base
1. Overview
Interface name: Get the directory tree under the knowledge base
Version number: v1.0.0
2. Information
Request method: POST
Request URL: https://DOMAIN/openapi/v1/knowledge/folder-tree/
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
knowledge_base_id
string
Yes
Knowledge Base id
4. Response field description
HTTP status code: 200 OK
Response field description:
code
string
"000000" is normal, other exceptions
message
string
Status description
data
object
message body
id
int
Dataset or folder id
name
string
Dataset or folder name
folder_type
int
folder type (1: text dataset 2: QA dataset 3: folder)
parent_id
int
Dataset or folder parent node id
children
list
Dataset or folder subnode
5. Example
Request Example:
curl --location 'https://_DOMAIN_/openapi/v1/knowledge/folder-tree/' \
--header 'cybertron-robot-key: l8ia2IOc************Z724%2BU%3D' \
--header 'cybertron-robot-token: MTc0Mzk5************************************************cGRCUTg9' \
--header 'Content-Type: application/json' \
--data '{
"username": "me@host.com",
"knowledge_base_id": "1178"
}'
Response example:
[
{
"id": 3433,
"name": "Text",
"folder_type": 1,
"parent_id": null,
"children": []
},
{
"id": 3434,
"name": "Q&A",
"folder_type": 2,
"parent_id": null,
"children": []
}
]Last updated