跳至主要内容

新增常見問題

新增一條常見問題知識。

請求

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": ""
}