Get FAQ Category List
Request URL
Request Parameters
Query Parameters
| Parameter | Type | Optional | Description |
|---|
| robotId | Integer | false | Robot ID |
Response
| Path | Type | Description |
|---|
| code | Integer | Execution result code |
| message | String | Execution result explanation |
| data | Array | Category information |
| data[].id | Integer | Category ID |
| data[].name | String | Category name |
| data[].parentId | Integer | Parent ID of the category |
| data[].parentIds | String | Parent ID path of the category, separated by commas |
| data[].robotId | Integer | Robot ID |
| data[].type | Integer | 1: System category (All, Unclassified) 2: User-defined category |
| data[].classify | Integer | 1: FAQ category |
Example
$ curl 'https://km.udesk.cn/api/v1/categories?email=admin@udesk.cn×tamp=1529402433&sign=e4f683120c26df279b3642ac77b0bd8bf621584a&robotId=102' -i -H 'Accept: application/json'
Response
{
"code" : 200,
"message" : "OK",
"visible" : false,
"data" : [ {
"id" : 406,
"name" : "category 2",
"parentId" : 342,
"parentIds" : "0,342,",
"robotId" : 102
}, {
"id" : 342,
"name" : "all",
"parentId" : 0,
"parentIds" : "0,",
"robotId" : 102
}, {
"id" : 343,
"name" : "Uncategorized",
"parentId" : 342,
"parentIds" : "0,342,",
"robotId" : 102
} ]
}
Get FAQ Category Details
Request URL
Request Parameters
Path parameters
| Parameter | Type | Optional | Description |
|---|
| id | Integer | false | Category ID |
Response
| Path | Type | Description |
|---|
| code | Integer | Execution result code |
| message | String | Execution result explanation |
| data | Object | Knowledge base information |
| data.id | Integer | Category ID |
| data.name | String | Category name |
| data.parentId | Integer | Parent ID of the category |
| data.parentIds | String | Parent ID path of the category, separated by commas |
| data.robotId | Integer | Robot ID |
| data.type | Integer | 1: System category (All, Unclassified) 2: User-defined category |
| data.classify | Integer | 1: FAQ category |
Example
$ curl 'https://km.udesk.cn/api/v1/categories/403?email=admin@udesk.cn×tamp=1529402429&sign=c8b3e4dfef80a80e6125d2863912f6cdf1d20509' -i -H 'Accept: application/json'
Response
{
"code" : 200,
"message" : "OK",
"visible" : false,
"data" : {
"id" : 403,
"name" : "category 2",
"parentId" : 342,
"parentIds" : "0,342,",
"robotId" : 102,
"type": 2,
"classify": 1
}
}
Failure Reasons
| Message | Description |
|---|
| "Required int parameter 'robotId' is not present" | The value of robotId in the parameters cannot be empty |
Delete FAQ Category
Request URL
- DELETE /v1/categories/:id
Request Parameters
Path parameters
| Parameter | Type | Optional | Description |
|---|
| id | Integer | false | Category ID |
Response
- None. When deletion is successful, the HTTP response code is 204.
Example
$ 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'
Create New FAQ Category
Request URL
Request Parameters
Request Fields
| Parameter | Type | Optional | Description |
|---|
| name | String | false | Category name |
| parentId | Integer | false | Parent category ID |
| robotId | Integer | false | Robot ID |
| classify | Integer | true | 1. Knowledge base category 2. Greeting library category |
Response
| Path | Type | Description |
|---|
| code | Integer | Execution result code |
| message | String | Execution result explanation |
| data | Object | Category information |
| data.id | Integer | Category ID |
| data.name | String | Category name |
| data.parentId | Integer | Parent ID of the category |
| data.parentIds | String | Parent ID path of the category, separated by commas |
| data.robotId | Integer | Robot ID |
| data.type | Integer | 1: System category (All, Unclassified) 2: User-defined |
category |
| data.classify | Integer| 1: FAQ category |
Example
$ 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" : "category 2",
"parentId" : 342,
"robotId" : 102,
"classify": 1
}'
Response
{
"code" : 200,
"message" : "OK",
"visible" : false,
"data" : {
"id" : 404,
"name" : "category 2",
"parentId" : 342,
"parentIds" : "0,342,",
"robotId" : 102,
"num": null, #num indicates the number of FAQs under the current category
"type": 2,
"classify": 1
}
}
Failure Reasons
| Message | Description |
|---|
| "Duplicates name with existing directories" | Duplicate category name or abnormal value of integer parameters |
| "【name】org.hibernate.validator.constraints.NotBlank.message" | The name parameter cannot be empty |
| "【parentId】javax.validation.constraints.NotNull.message" | The parentId parameter cannot be empty |
| "【robotId】javax.validation.constraints.NotNull.message" | The robotId parameter cannot be empty |