使用客服码 Open API 以编程方式管理产品说明书、上传素材、触发生成和与 AI 客服交互。
需要认证的接口请在 HTTP 请求头中添加:
Authorization: Bearer YOUR_API_KEY
在 管理后台 > API 页面创建和管理 API Key。 Key 格式为 kfm_...
/api/projects需要认证创建新项目
Request Body
{
"productName": "My Product",
"summary": "A brief description"
}Response
{
"project": {
"id": "...",
"slug": "my-product",
"productName": "My Product"
}
}/api/projects需要认证列出当前用户的所有项目
Response
{
"projects": [
{
"slug": "my-product",
"productName": "My Product",
"status": "published"
}
]
}/api/projects/:slug/materials需要认证上传素材(JSON 文本或 FormData 文件)
Request Body
{
"title": "FAQ Document",
"type": "TXT",
"summary": "",
"content": "The full text..."
}Response
{
"material": {
"id": "mat_xxx",
"title": "FAQ Document",
"status": "parsed"
}
}/api/projects/:slug/generate需要认证触发 AI 重新生成说明书内容(异步)
Response
{
"status": "generating"
}/api/projects/:slug/publish需要认证发布当前草稿为新版本
Response
{
"project": {
"status": "published",
"versions": [
"v1.0"
]
}
}/api/projects/:slug/chat向 AI 客服提问(无需鉴权)
Request Body
{
"question": "How do I reset my device?"
}Response
{
"answer": "To reset your device...",
"references": [
"sec_01"
],
"confidenceLabel": "high",
"suggestedQuestions": [
"..."
]
}/api/projects/:slug/qr获取项目二维码图片(PNG/SVG)
Response
Binary image data (PNG)
/api/projects/:slug/pdf下载产品说明书 PDF
Response
Binary PDF data