跳至主要内容

编辑文档知识

更新文章知识内容。

请求​

POST https://apichat.twt.com/openapi/zhishi/edit_doc

Header 参数​

参数名类型必填说明
x-chat-signaturestring是HMAC-SHA256 签名
Acceptstring否默认值:application/json
Content-Typestring是application/json

Body 参数​

参数名类型必填说明
appidstring是应用标识
timestampinteger是请求时间戳
ranstrstring是随机字符串
idinteger是已有的文章知识 ID
mcstring是更新后的文章标题,1 至 255 个字符
nrstring是更新后的文章内容,1 至 2000 个字符

请求示例​

{
"appid": "your-appid",
"timestamp": 1735689600,
"ranstr": "random-string",
"id": 1002,
"mc": "使用入门",
"nr": "更新后的文章内容。"
}

返回响应​

200 成功​

参数名类型必填说明
codeinteger是1 正常,-1 失败
msgstring是响应信息
datastring是响应数据
{
"code": 1,
"msg": "ok",
"data": ""
}

错误示例​

{
"code": -1,
"msg": "参数错误",
"data": ""
}