跳至主要内容

新增常见问题

新增一条常见问题知识。

请求

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

Header 参数

参数名类型必填说明
x-chat-signaturestringHMAC-SHA256 签名
Acceptstring默认值:application/json
Content-Typestringapplication/json

Body 参数

参数名类型必填说明
appidstring应用标识
timestampinteger请求时间戳
ranstrstring随机字符串
lxinteger常见问题必须传 4
mcstring问题标题,1 至 255 个字符
nrstring答案内容,1 至 2000 个字符
xs_mcstring[]相似问题标题,最多 10 条

请求示例

{
"appid": "your-appid",
"timestamp": 1735689600,
"ranstr": "random-string",
"lx": 4,
"mc": "如何重置密码?",
"nr": "请使用登录页上的密码重置链接。"
}

返回响应

200 成功

参数名类型必填说明
codeinteger1 正常,-1 失败
msgstring响应信息
data.idinteger本次新增的主知识库 ID
data.idsinteger[]本次实际创建的全部 ID,包含相似问题
{
"code": 1,
"msg": "ok",
"data": {
"id": 1001,
"ids": [1001]
}
}

错误示例

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