获取FAQ分类列表
请求地址
请求参数
Query parameters
| Parameter | 
Type | 
Optional | 
Description | 
| robotId | 
Integer | 
false | 
机器人ID. | 
请求结果
| Path | 
Type | 
Description | 
| code | 
Integer | 
执行结果码 | 
| message | 
String | 
执行结果说明 | 
| data | 
Array | 
分类信息 | 
| data[].id | 
Integer | 
分类ID. | 
| data[].name | 
String | 
分类名称. | 
| data[].parentId | 
Integer | 
分类的父ID. | 
| data[].parentIds | 
String | 
分类的父ID路径,逗号分隔. | 
| data[].robotId | 
Integer | 
机器人ID. | 
| data[].type | 
Integer | 
1:系统分类(全部,未分类)2:用户自定义分类 | 
| data[].classify | 
Integer | 
1:表示faq的分类 | 
| data[].num | 
Integer | 
分类下faq的个数 | 
示例
$ curl 'https://km.udesk.cn/api/v1/categories?email=admin@udesk.cn×tamp=1529402433&sign=e4f683120c26df279b3642ac77b0bd8bf621584a&robotId=102' -i -H 'Accept: application/json'
返回
{
  "code" : 200,
  "message" : "OK",
  "visible" : false,
  "data" : [ {
    "id" : 406,
    "name" : "分类2",
    "parentId" : 342,
    "parentIds" : "0,342,",
    "robotId" : 102,
    "type" : 1,
    "classify" : 1,
    "num" : 10
  }, {
    "id" : 342,
    "name" : "全部",
    "parentId" : 0,
    "parentIds" : "0,",
    "robotId" : 102,
    "type" : 1,
    "classify" : 1,
    "num" : 10
  }, {
    "id" : 343,
    "name" : "未分类",
    "parentId" : 342,
    "parentIds" : "0,342,",
    "robotId" : 102,
    "type" : 1,
    "classify" : 1,
    "num" : 10
  } ]
}
获取FAQ知识库分类详情
请求地址
请求参数
Path parameters
| Parameter | 
Type | 
Optional | 
Description | 
| id | 
Integer | 
false | 
分类ID. | 
请求结果
| Path | 
Type | 
Description | 
| code | 
Integer | 
执行结果码 | 
| message | 
String | 
执行结果说明 | 
| data | 
Object | 
知识库信息 | 
| data.id | 
Integer | 
分类ID. | 
| data.name | 
String | 
分类名称. | 
| data.parentId | 
Integer | 
分类的父ID. | 
| data.parentIds | 
String | 
分类的父ID路径,逗号分隔. | 
| data.robotId | 
Integer | 
机器人ID. | 
| data.type | 
Integer | 
1:系统分类(全部,未分类)2:用户自定义分类 | 
| data.classify | 
Integer | 
1:FAQ分类 | 
| data.num | 
Integer | 
分类下faq的个数 | 
示例
$ curl 'https://km.udesk.cn/api/v1/categories/403?email=admin@udesk.cn×tamp=1529402429&sign=c8b3e4dfef80a80e6125d2863912f6cdf1d20509' -i -H 'Accept: application/json'
返回
{
  "code" : 200,
  "message" : "OK",
  "visible" : false,
  "data" : {
    "id" : 403,
    "name" : "分类2",
    "parentId" : 342,
    "parentIds" : "0,342,",
    "robotId" : 102, 
    "type": 2,
    "classify": 1,
    "num": 10
  }
}
请求失败原因
| Message | 
Description | 
| "Required int parameter 'robotId' is not present" | 
参数中robotId的值不能为空 | 
删除FAQ知识库分类
请求地址
- DELETE /v1/categories/:id
 
请求参数
Path parameters
| Parameter | 
Type | 
Optional | 
Description | 
| id | 
Integer | 
false | 
分类ID. | 
请求结果
示例
$ curl 'https://km.udesk.cn/api/v1/categories/379?email=admin@udesk.cn×tamp=1529402432&sign=67df1ddd1aad415933d63da93ca24b59c8970740' -i -X DELETE -H 'Content-Type: application/json'
新建FAQ知识库分类
请求地址
请求参数
Request fields
| Parameter | 
Type | 
Optional | 
Description | 
| name | 
String | 
false | 
分类名称. | 
| parentId | 
Integer | 
false | 
分类的父级ID. | 
| robotId | 
Integer | 
false | 
机器人ID. | 
| classify | 
Integer | 
true | 
1.知识库分类 2.寒暄库分类. | 
请求结果
| Path | 
Type | 
Description | 
| code | 
Integer | 
执行结果码 | 
| message | 
String | 
执行结果说明 | 
| data | 
Object | 
分类信息 | 
| data.id | 
Integer | 
分类ID. | 
| data.name | 
String | 
分类名称. | 
| data.parentId | 
Integer | 
分类的父ID. | 
| data.parentIds | 
String | 
分类的父ID路径,逗号分隔. | 
| data.robotId | 
Integer | 
机器人ID. | 
| data.type | 
Integer | 
1:系统分类(全部,未分类)2:用户自定义分类 | 
| data.classify | 
Integer | 
1:表示faq的分类 | 
示例
$ curl 'https://km.udesk.cn/api/v1/categories?email=admin@udesk.cn×tamp=1529402431&sign=bd23cf273d088d9c9031958712670673dae1d5ce' -i -X POST -H 'Content-Type: application/json' -d '{
  "name" : "分类2",
  "parentId" : 342,
  "robotId" : 102,
  "classify": 1
}'
返回
{
  "code" : 200,
  "message" : "OK",
  "visible" : false,
  "data" : {
    "id" : 404,
    "name" : "分类2",
    "parentId" : 342,
    "parentIds" : "0,342,",
    "robotId" : 102,
    "num": null, #num表示当前分类下FAQ数量
    "type": 2,
    "classify": 1
  }
}
请求失败原因
| Message | 
Description | 
| "Duplicates name with existing directories" | 
已有同名的分类或整型参数的值异常 | 
| "【name】org.hibernate.validator.constraints.NotBlank.message" | 
参数中name不能为空 | 
| "【parentId】javax.validation.constraints.NotNull.message" | 
参数中parentId不能为空 | 
| "【robotId】javax.validation.constraints.NotNull.message" | 
参数中robotId不能为空 |