Skip to main content

Create FAQ

Create one FAQ knowledge entry.

Request

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

Header Parameters

ParameterTypeRequiredDescription
x-chat-signaturestringYesHMAC-SHA256 signature
AcceptstringNoDefault: application/json
Content-TypestringYesapplication/json

Body Parameters

ParameterTypeRequiredDescription
appidstringYesApplication identifier from the console
timestampintegerYesRequest timestamp
ranstrstringYesRandom string
lxintegerYesMust be 4 for FAQ
mcstringYesQuestion title, 1 to 255 characters
nrstringYesAnswer content, 1 to 2000 characters
xs_mcstring[]NoSimilar question titles, up to 10 entries

Request Example

{
"appid": "your-appid",
"timestamp": 1735689600,
"ranstr": "random-string",
"lx": 4,
"mc": "How do I reset my password?",
"nr": "Use the password reset link on the sign-in page."
}

Response

200 Success

ParameterTypeRequiredDescription
codeintegerYes1 success, -1 failure
msgstringYesResponse message
data.idintegerYesPrimary newly created knowledge ID
data.idsinteger[]YesAll IDs created by this request, including similar questions
{
"code": 1,
"msg": "ok",
"data": {
"id": 1001,
"ids": [1001]
}
}

Error Example

{
"code": -1,
"msg": "Invalid parameters",
"data": ""
}