Create FAQ
Create one FAQ knowledge entry.
Request
POST https://apichat.twt.com/openapi/zhishi/create_qa
Header Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
x-chat-signature | string | Yes | HMAC-SHA256 signature |
Accept | string | No | Default: application/json |
Content-Type | string | Yes | application/json |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
appid | string | Yes | Application identifier from the console |
timestamp | integer | Yes | Request timestamp |
ranstr | string | Yes | Random string |
lx | integer | Yes | Must be 4 for FAQ |
mc | string | Yes | Question title, 1 to 255 characters |
nr | string | Yes | Answer content, 1 to 2000 characters |
xs_mc | string[] | No | Similar 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
| Parameter | Type | Required | Description |
|---|---|---|---|
code | integer | Yes | 1 success, -1 failure |
msg | string | Yes | Response message |
data.id | integer | Yes | Primary newly created knowledge ID |
data.ids | integer[] | Yes | All 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": ""
}