2.6.2-Document File Knowledge Modify

1. Overview

  • Interface name: Single file knowledge modification

  • Version number: v1.0.0

2. Information

  • Request method: PUT

  • Request URL: https://DOMAIN/openapi/v1/knowledge/file/

  • Domain: Refer to "Service address description"

3. Request parameters

Request header http header field:

Parameter name
Type
Required
Description

Content-Type

string

Yes

Fixedapplication/json

cybertron-robot-key

string

Yes

Robot key

cybertron-robot-token

string

Yes

Robot token

Request body field:

Parameter name
Type
Required
Description

username

string

Yes

User account

id

int

Yes

File Knowledge id

knowledge_base_id

string

Yes

Knowledge Base id

content

string

Yes

File knowledge content

knowledge_image

array

No

Knowledge-related pictures (returned image name is required through the uploading platform for the image upload interface)

knowledge_attachment

array

No

Knowledge-related attachments

4. Response field description

HTTP status code: 200 OK

Response field description:

Field Name
Type
Description

code

string

"000000" is normal, other exceptions

message

string

Status description

data

object

message body

id

int

paragraph text id

5. Example

Request Example:

curl 'https://_DOMAIN_/openapi/v1/knowledge/file/' \
-H 'Content-Type: application/json' \
-H 'cybertron-robot-key: l8ia2IOc************Z724%2BU%3D' \
-H 'cybertron-robot-token: MTc0Mzk5************************************************cGRCUTg9' \
-X PUT -d '{
    "username": "me@host.com",
    "knowledge_base_id": "324",
    "id": 179719,
    "content": "Test modification",
    "knowledge_image": [
        "172180700265d0ffb0-e821-44f4-9a12-be289220b151.jpeg"
    ],
    "knowledge_attachment": [
        "172180700265d0ffb0-e821-44f4-9a12-be289220b151.jpeg"
    ]
}'

Response example:

{
    "code": "000000",
    "message": "Knowledge has been entered, and is being studied...",
    "data": {
        "id": 179719,
        "knowledge_image_list": [],
        "creator_name": "zhengdong.zhou",
        "editor_name": "zhengdong.zhou",
        "section_pk": "3028_1",
        "content": "test modification",
        "data_source": 1,
        "knowledge_image": "{}",
        "emb_status": 1,
        "create_time": "2024-07-24 17:37:28",
        "update_time": "2024-07-24 17:48:24",
        "knowledge_base": 324,
        "knowledge_file": 3028,
        "creator": 61,
        "editor": 61
    }
}