Template Deletion API
Request Endpoint
- DELETE /v1/datumTemplates/:id
Request Parameters
Request parameters
Parameter | Type | Optional | Description |
---|
id | Integer | false | Template ID |
Response Result
- None, HTTP response code is 204 when deletion is successful
Example
$ curl 'https://km.udesk.cn/api/v1/datumTemplates/57?email=admin@udesk.cn×tamp=1573026139&sign=31322f38618d50ee671ef073305ac9917e652374' -i -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'
Get Template Details API
Request Endpoint
- GET /v1/datumTemplates/:id
Request Parameters
Request fields
path | Type | Optional | Description |
---|
id | Integer | false | Template ID. |
Response Result
Path | Type | Description |
---|
code | Integer | Execution result code. |
message | String | Execution result description |
data | Object | Template information |
data[].id | Integer | Template ID |
data[].name | String | Template name |
data[].robotId | Integer | Robot ID |
data[].orders | Integer | Template order |
data[].parentId | Integer | Parent template ID (if it's a top-level template, it's 0, otherwise it's a specific ID) |
data[].remark | String | Template description (description length should not exceed 255 characters). |
data[].questionAndAnswerSet | Integer | Template QA settings (0. None 1. Default Reply 2. Clarification 4. Recommendation 8. Search) |
data[].similarList[] | String | Template aliases |
data[].attributes | Array | Template attribute list. |
data[].attributes[].id | Integer | Template attribute ID |
data[].attributes[].robotId | Integer | Robot ID |
data[].attributes[].templateId | Integer | Template ID |
data[].attributes[].name | String | Template attribute name |
data[].attributes[].allowInherited | Integer | Whether the template allows inheritance (0. No inheritance 1. Can inherit) |
data[].attributes[].answer | String | Attribute name |
data[].attributes[].askBack | String | Attribute probing method |
data[].attributes[].askBackFlag | Integer | Attribute probing method type |
data[].attributes[].switchStatus | Integer | Attribute switch (0. Off 1. On) |
data[].attributes[].similarList[] | String | Attribute aliases |
data[].attributes[].expressionList[] | String | Attribute expressions |
data[].datumDefaultAnswer | Array | Default reply for the datum |
data[].datumDefaultAnswer.id | Integer | ID |
data[].datumDefaultAnswer.robotId | Integer | Robot ID |
data[].datumDefaultAnswer.templateId | Integer | Template ID |
data[].datumDefaultAnswer.answerType | Integer | Reply type (1. Partial attributes 2. Trigger attribute probing 3. All attributes) |
data[].datumDefaultAnswer.attributeIdList[] | Integer | Attribute ID |
data[].datumRecommendation | Array | Datum recommendation |
data[].datumRecommendation.id | Integer | Datum ID |
data[].datumRecommendation.robotId | Integer | Robot ID |
data[].datumRecommendation.templateId | Integer | Template ID |
data[].datumRecommendation.noResultContent | String | Response when there is no result |
data[].datumRecommendation.recommendationNumber | Integer | Number of recommended data |
data[].datumSearch | Array | Datum search |
data[].datumSearch.id | Integer | ID |
data[].datumSearch.robotId | Integer | Robot ID |
data[].datumSearch.templateId | Integer | Template ID |
data[].datumSearch.noResultContent | String | Response when there is no result |
data[].datumSearch.recommendationNumber | Integer | Number of recommended data |
data[].datumSearch.strategies | Array | Datum search strategies |
data[].datumSearch.strategies[].id | Integer | ID |
data[].datumSearch.strategies[].robotId | Integer | Robot ID |
data[].datumSearch.strategies[].templateId | Integer | Template ID |
data[].datumSearch.strategies[].datumSearchId | Integer | Datum search ID |
data[].datumSearch.strategies[].name | String | Strategy name |
data[].datumSearch.strategies[].remark | String | Strategy description |
data[].datumSearch.strategies[].clarificationAskContent | String | Search strategy question |
data[].datumSearch.strategies[].retrievalTarget | Integer | Retrieval target 1: Get attribute 2: Get knowledge |
data[].datumSearch.strategies[].attributeId | Integer | Attribute ID When the retrieval target is to obtain the attribute, it is required (only one can be selected), not filled when getting knowledge, retrieving all data |
data[].datumSearch.strategies[].clarificationContent | String | Clarification response |
data[].datumSearch.strategies[].clarificationRounds | String | Clarification rounds |
data[].datumSearch.strategies[].failureContent | String | Failure response |
data[].datumSearch.strategies[].orders | Integer | Priority sorting |
Example
$ curl 'https://km.udesk.cn/api/v1/datumTemplates/56?email=admin@udesk.cn×tamp=1559022283&sign=aa8164470dff8468e6129c1e7d5767651cdedd7c' -i -X GET -H 'Content-Type: application/json' -H 'Accept: application/json'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"data": {
"id": 56,
"name": "Template",
"robotId": 83,
"orders": 1,
"parentId": 21,
"parentIds": "0-21",
"remark": "Template description",
"questionAndAnswerSet": 15,
"attributes": [
{
"id": 135,
"name": "Attribute1",
"robotId": 83,
"templateId": 56,
"similarList": [
"Attribute1_alias",
"Attribute1_alias2"
],
"askBack": "Which Attribute1 do you want to know?",
"askBackFlag": 0,
"orders": 1,
"allowInherited": 1,
"switchStatus": 1,
"answer": "<p>Attribute1 value</p>",
"expressionList": [
"Expression1",
"Expression2"
]
},
{
"id": 136,
"name": "Attribute2",
"robotId": 83,
"templateId": 56,
"similarList": [
"Attribute2_alias",
"Attribute2_alias2"
],
"askBack": "Which Attribute2 do you want to know?",
"askBackFlag": 0,
"orders": 2,
"allowInherited": 1,
"switchStatus": 1,
"answer": "<p>Attribute2 value</p>",
"expressionList": [
"Expression3",
"Expression4"
]
}
],
"similarList": [
"Template_alias"
],
"datums": [],
"datumDefaultAnswer": {
"id": 8,
"answerType": 3,
"robotId": 83,
"templateId": 56,
"attributeIdList": [
null
]
},
"datumRecommendation": {
"id": 3,
"robotId": 83,
"templateId": 56,
"recommendationNumber": 3,
"noResultContent": "Sorry, we couldn't find any data based on your criteria, please rephrase your question"
},
"datumSearch": {
"id": 3,
"robotId": 83,
"templateId": 56,
"recommendationNumber": 3,
"noResultContent": "Sorry, we couldn't find any data based on your criteria, please rephrase your question",
"strategies": [
{
"id": 2,
"robotId": 83,
"templateId": 56,
"datumSearchId": 3,
"name": "Strategy2",
"remark": "Strategy2 description",
"retrievalTarget": 2,
"attributeId": null,
"clarificationAskContent": "Is this Strategy2?",
"clarificationContent": "Strategy2 clarification tree",
"clarificationRounds": 2,
"failureContent": "Sorry, search failed, please rephrase your question",
"orders": 1
},
{
"id": 3,
"robotId": 83,
"templateId": 56,
"datumSearchId": 3,
"name": "Search Strategy",
"remark": "Search Strategy description",
"retrievalTarget": 2,
"attributeId": null,
"clarificationAskContent": "Search strategy question",
"clarificationContent": "Clarification tree",
"clarificationRounds": 2,
"failureContent": "Sorry, search failed, please rephrase your question",
"orders": 2
}
]
}
}
}
Request Failure Reasons
message | description |
---|
"The data has been deleted or does not exist" | The template corresponding to the ID does not exist. |
New Template Interface
Request Address
Request Parameters
Request fields
Path | Type | Optional | Description |
---|
name | String | false | Template Name |
robotId | Integer | false | Robot ID |
parentId | Integer | false | Inherited Template (if it's a top-level template, set to 0, for non-top-level templates, pass the parent template ID) |
remark | String | true | Template Description (Description length cannot exceed 255 characters) |
questionAndAnswerSet | Integer | false | Template Question and Answer Set (0. None 1. Default Reply 2. Clarification 4. Recommendation 8. Search) |
similarList[] | String | true | Alias |
attributes | Array | true | Attribute List |
attributes[].name | String | true | Attribute Name |
attributes[].allowInherited | Integer | false | Allow Inheritance (0. Do not inherit 1. Can inherit) |
attributes[].answer | String | true | Attribute Value |
attributes[].askBack | String | true | Ask-back Method |
attributes[].askBackFlag | Integer | true | Ask-back Method Type |
attributes[].switchStatus | Integer | false | Attribute Switch (0. Off 1. On) |
attributes[].changeType | Integer | false | Change Type (0. No Change 1. Add 2. Update 3. Delete) |
attributes[].similarList[] | String | true | Attribute Alias |
attributes[].expressionList[] | String | true | Attribute Expression |
datumDefaultAnswer | Array | true | Default Replies |
datumDefaultAnswer.answerType | Integer | false | Reply Type (1. Partial Attributes 2. Trigger Attribute Ask-back 3. All Attributes) |
datumDefaultAnswer.attributeIdList[] | Integer | true | Attribute ID (mandatory when reply type is not all attributes) |
datumRecommendation | Array | true | Recommendations |
datumRecommendation.noResultContent | String | false | No Result Content |
datumRecommendation.recommendationNumber | Integer | false | Number of Recommended Knowledge Points |
datumSearch | Object | true | Knowledge Point Search |
datumSearch.noResultContent | String | false | No Result Content |
datumSearch.recommendationNumber | Integer | false | Number of Recommended Knowledge Points |
datumSearch.strategies | Array | true | Search Strategies |
datumSearch.strategies[].name | String | false | Strategy Name |
datumSearch.strategies[].remark | String | true | Strategy Description |
datumSearch.strategies[].clarificationAskContent | String | false | Clarification Ask Content |
datumSearch.strategies[].retrievalTarget | Integer | false | Retrieval Target (1: Get Attributes 2: Get Knowledge) |
datumSearch.strategies[].attributeId | Integer | true | Attribute ID (mandatory when retrieval target is to get attributes, only one can be selected), not required when getting knowledge, search all knowledge points |
datumSearch.strategies[].clarificationContent | String | true | Clarification Content |
datumSearch.strategies[].clarificationRounds | String | true | Clarification Rounds |
datumSearch.strategies[].failureContent | String | true | Failure Content |
datumClarify | Object | true | Knowledge Point Clarification |
datumClarify.robotId | Integer | true | Robot ID |
datumClarify.templateId | Integer | true | Template ID |
datumClarify.recommendationNumber | Integer | true | Number of Recommended Knowledge Points |
datumClarify.noResultContent | String | true | No Result Content |
datumClarify.clarifyType | Integer | true | Search Strategy 1. Attribute Ask-back 2. Strategy Follow-up |
datumClarify.askType | String | true | Search Type 1. Priority 2. Intelligent Search |
datumClarify.strategies | Array | true | Strategy Name |
datumClarify.strategies[].robotId | Integer | true | Robot ID |
datumClarify.strategies[].templateId | Integer | true | Template ID |
datumClarify.strategies[].datumClarifyId | Integer | true | Knowledge Point Clarification ID |
datumClarify.strategies[].name | String | true | Strategy Name |
datumClarify.strategies[].remark | String | true | Strategy Description |
datumClarify.strategies[].clarificationAskContent | String | true | Clarification Ask Content |
datumClarify.strategies[].retrievalTarget | Integer | true | Retrieval Target 1: Get Attributes 2: Get Knowledge |
datumClarify.strategies[].attributeId | Integer | true | Attribute ID (mandatory when retrieval target is to get attributes, only one can be selected), not required when getting knowledge, search all knowledge points |
datumClarify.strategies[].alternativePushContent | Object | true | Alternative Push Switch |
datumClarify.strategies[].alternativePushStatus.chosen | Integer | true | Selected Style 0 1 2 |
datumClarify.strategies[].alternativePushStatus.style | String | true | Style Template |
datumClarify.strategies[].alternativePushStatus.labelList | Array | true | Label List |
datumClarify.strategies[].alternativePushStatus.labelList[].id | Integer | true | Label ID |
datumClarify.strategies[].alternativePushStatus.labelList[].name | Integer | true | Label Name |
datumClarify.strategies[].alternativePushStatus.labelList[].content | Integer | true | Label Content |
datumClarify.strategies[].clarificationContent | String | true | Clarification Content |
datumClarify.strategies[].clarificationRounds | String | true | Clarification Rounds |
datumClarify.strategies[].failureContent | String | true | Failure Content |
datumClarify.strategies[].orders | Integer | true | Order Priority |
Request Result
Path | Type | Description |
---|
code | Integer | Execution Result Code |
message | String | Execution Result Description |
data | Object | Template Information |
data[].id | Integer | Template ID |
data[].name | String | Template Name |
data[].robotId | Integer | Robot ID |
data[].orders | Integer | Order |
data[].parentId | Integer | Inherited Template |
data[].remark | String | Template Description |
data[].questionAndAnswerSet | Integer | Template Question and Answer Set (0. None 1. Default Reply 2. Clarification 4. Recommendation 8. Search) |
data[].similarList[] | String | Alias |
data[].attributes | Array | Attribute List |
data[].attributes[].id | Integer | ID |
data[].attributes[].robotId | Integer | Robot ID |
data[].attributes[].templateId | Integer | Template ID |
data[].attributes[].name | String | Attribute Name |
data[].attributes[].allowInherited | Integer | Allow Inheritance (0. Do not inherit 1. Can inherit) |
data[].attributes[].answer | String | Attribute Value |
data[].attributes[].askBack | String | Ask-back Method |
data[].attributes[].askBackFlag | Integer | Ask-back Method Type |
data[].attributes[].switchStatus | Integer | Attribute Switch (0. Off 1. On) |
data[].attributes[].changeType | Integer | Change Type (0. No Change 1. Add 2. Update 3. Delete) |
data[].attributes[].similarList[] | String | Attribute Alias |
data[].attributes[].expressionList[] | String | Attribute Expression |
data[].datumDefaultAnswer | Array | Data Default Reply |
data[].datumDefaultAnswer.id | Integer | ID |
data[].datumDefaultAnswer.robotId | Integer | Robot ID |
data[].datumDefaultAnswer.templateId | Integer | Template ID |
data[].datumDefaultAnswer.answerType | Integer | Reply Type (1. Partial Attributes 2. Trigger Attribute Ask-back 3. All Attributes) |
data[].datumDefaultAnswer.attributeIdList[] | Integer | Attribute ID (mandatory when reply type is not all attributes) |
data[].datumRecommendation | Array | Knowledge Point Recommendation |
data[].datumRecommendation.id | Integer | ID |
data[].datumRecommendation.robotId | Integer | Robot ID |
data[].datumRecommendation.templateId | Integer | Template ID |
data[].datumRecommendation.noResultContent | String | No Result Content |
data[].datumRecommendation.recommendationNumber | Integer | Number of Recommended Knowledge Points |
data[].datumSearch | Array | Knowledge Point Search |
data[].datumSearch.id | Integer | ID |
data[].datumSearch.robotId | Integer | Robot ID |
data[].datumSearch.templateId | Integer | Template ID |
data[].datumSearch.noResultContent | String | No Result Content |
data[].datumSearch.recommendationNumber | Integer | Number of Recommended Knowledge Points |
data[].datumSearch.strategies | Array | Knowledge Point Search Strategy |
data[].datumSearch.strategies[].id | Integer | ID |
data[].datumSearch.strategies[].robotId | Integer | Robot ID |
data[].datumSearch.strategies[].templateId | Integer | Template ID |
data[].datumSearch.strategies[].datumSearchId | Integer | Knowledge Point Search ID |
data[].datumSearch.strategies[].name | String | Strategy Name |
data[].datumSearch.strategies[].remark | String | Strategy Description |
data[].datumSearch.strategies[].clarificationAskContent | String | Clarification Ask Content |
data[].datumSearch.strategies[].retrievalTarget | Integer | Retrieval Target (1. Get Attributes 2. Get Knowledge) |
data[].datumSearch.strategies[].attributeId | Integer | Attribute ID (mandatory when retrieval target is to get attributes, only one can be selected), not required when getting knowledge, search all knowledge points |
data[].datumSearch.strategies[].clarificationContent | String | Clarification Content |
data[].datumSearch.strategies[].clarificationRounds | String | Clarification Rounds |
data[].datumSearch.strategies[].failureContent | String | Failure Content |
data[].datumClarify | Object | Knowledge Point Clarification |
data[].datumClarify.robotId | Integer | Robot ID |
data[].datumClarify.templateId | Integer | Template ID |
data[].datumClarify.recommendationNumber | Integer | Number of Recommended Knowledge Points |
data[].datumClarify.noResultContent | String | No Result Content |
data[].datumClarify.clarifyType | Integer | Search Strategy 1. Attribute Ask-back 2. Strategy Follow-up |
data[].datumClarify.askType | String | Search Type 1. Priority 2. Intelligent Search |
data[].datumClarify.strategies | Array | Strategy Name |
data[].datumClarify.strategies[].robotId | Integer | Robot ID |
data[].datumClarify.strategies[].templateId | Integer | Template ID |
data[].datumClarify.strategies[].datumClarifyId | Integer | Knowledge Point Clarification ID |
data[].datumClarify.strategies[].name | String | Strategy Name |
data[].datumClarify.strategies[].remark | String | Strategy Description |
data[].datumClarify.strategies[].clarificationAskContent | String | Clarification Ask Content |
data[].datumClarify.strategies[].retrievalTarget | Integer | Retrieval Target (1: Get Attributes 2: Get Knowledge) |
data[].datumClarify.strategies[].attributeId | Integer | Attribute ID (mandatory when retrieval target is to get attributes, only one can be selected), not required when getting knowledge, search all knowledge points |
data[].datumClarify.strategies[].alternativePushContent | Object | Alternative Push Switch |
data[].datumClarify.strategies[].alternativePushStatus.chosen | Integer | Selected Style 0 1 2 |
data[].datumClarify.strategies[].alternativePushStatus.style | String | Style Template |
data[].datumClarify.strategies[].alternativePushStatus.labelList | Array | Label List |
data[].datumClarify.strategies[].alternativePushStatus.labelList[].id | Integer | Label ID |
data[].datumClarify.strategies[].alternativePushStatus.labelList[].name | Integer | Label Name |
data[].datumClarify.strategies[].alternativePushStatus.labelList[].content | Integer | Label Content |
data[].datumClarify.strategies[].clarificationContent | String | Clarification Content |
data[].datumClarify.strategies[].clarificationRounds | String | Clarification Rounds |
data[].datumClarify.strategies[].failureContent | String | Failure Content |
data[].datumClarify.strategies[].orders | Integer | Order Priority |
Example
$ curl 'https://km.udesk.cn/api/v1/datumTemplates?email=admin@udesk.cn×tamp=1559016113&sign=f16d7f6fcc3fbab73855f4510cd4904f0f60e258' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
"name": "Small Template",
"robotId": 83,
"similarList": ["Template Alias"],
"parentId": 21,
"remark": "Template Description",
"questionAndAnswerSet": 15,
"attributes": [{
"name": "Template Attribute 2",
"similarList": ["Template Attribute 2 Alias", "Template Attribute 2 Alias 2"],
"allowInherited": 1,
"answer": "<p>Template Attribute 2 Value</p>",
"askBack": "Which template attribute 2 do you want to know about?",
"askBackFlag": 0,
"switchStatus": 1,
"expressionList": ["Hello", "haha"],
"changeType": 1
}, {
"name": "Template Attribute",
"similarList": ["Template Attribute Alias", "Template Attribute Alias 2"],
"allowInherited": 1,
"answer": "<p>Template Attribute Value</p>",
"askBack": "Which template attribute do you want to know about?",
"askBackFlag": 0,
"switchStatus": 1,
"expressionList": ["Template Attribute Expression", "Template Attribute Expression 2"],
"changeType": 1
}],
"datumDefaultAnswer": {
"answerType": 3
},
"datumRecommendation": {
"noResultContent": "Sorry, cannot find knowledge points based on your criteria, please ask again",
"recommendationNumber": 3
},
"datumSearch": {
"noResultContent": "Sorry, cannot find knowledge points based on your criteria, please ask again",
"recommendationNumber": 3,
"strategies": [{
"name": "Strategy 2",
"remark": "Strategy 2 Description",
"clarificationAskContent": "Strategy 2 Clarification Ask",
"retrievalTarget": 2,
"clarificationContent": "Strategy 2 Clarification Content",
"clarificationRounds": 2,
"failureContent": "Sorry, search failed, please ask again"
}, {
"name": "Search Strategy",
"remark": "Search Strategy Description",
"clarificationAskContent": "Search Strategy Clarification Ask",
"retrievalTarget": 2,
"clarificationContent": "Search Strategy Clarification Content",
"clarificationRounds": 2,
"failureContent": "Sorry, search failed, please ask again"
}]
}
}'
Return
{
"code": 200,
"message": "OK",
"visible": false,
"data": {
"id": 56,
"name": "Small Template",
"robotId": 83,
"orders": 1,
"parentId": 21,
"parentIds": "0-21",
"remark": "Template Description",
"questionAndAnswerSet": 15,
"attributes": [
{
"id": 135,
"name": "Template Attribute 2",
"robotId": 83,
"templateId": 56,
"similarList": [
"Template Attribute 2 Alias",
"Template Attribute 2 Alias 2"
],
"askBack": "Which template attribute 2 do you want to know about?",
"askBackFlag": 0,
"orders": 1,
"allowInherited": 1,
"switchStatus": 1,
"answer": "<p>Template Attribute 2 Value</p>",
"expressionList": [
"Hello",
"haha"
]
},
{
"id": 136,
"name": "Template Attribute",
"robotId": 83,
"templateId": 56,
"similarList": [
"Template Attribute Alias",
"Template Attribute Alias 2"
],
"askBack": "Which template attribute do you want to know about?",
"askBackFlag": 0,
"orders": 2,
"allowInherited": 1,
"switchStatus": 1,
"answer": "<p>Template Attribute Value</p>",
"expressionList": [
"Template Attribute Expression",
"Template Attribute Expression 2"
]
}
],
"similarList": [
"Template Alias"
],
"datums": [],
"datumDefaultAnswer": {
"id": null,
"answerType": 3,
"robotId": 83,
"templateId": 56,
"attributeIdList": null
},
"datumRecommendation": {
"id": 3,
"robotId": 83,
"templateId": 56,
"recommendationNumber": 3,
"noResultContent": "Sorry, cannot find knowledge points based on your criteria, please ask again"
},
"datumSearch": {
"id": 3,
"robotId": 83,
"templateId": 56,
"recommendationNumber": 3,
"noResultContent": "Sorry, cannot find knowledge points based on your criteria, please ask again",
"strategies": [
{
"id": 1,
"robotId": 83,
"templateId": 56,
"datumSearchId": 3,
"name": "Strategy 2",
"remark": "Strategy 2 Description",
"retrievalTarget": 2,
"attributeId": 1,
"clarificationAskContent": "Strategy 2 Clarification Ask",
"clarificationContent": "Strategy 2 Clarification Content",
"clarificationRounds": 2,
"failureContent": "Sorry, search failed, please ask again",
"orders": 1
},
{
"id": 2,
"robotId": 83,
"templateId": 56,
"datumSearchId": 3,
"name": "Search Strategy",
"remark": "Search Strategy Description",
"retrievalTarget": 2,
"attributeId": 2,
"clarificationAskContent": "Search Strategy Clarification Ask",
"clarificationContent": "Search Strategy Clarification Content",
"clarificationRounds": 2,
"failureContent": "Sorry, search failed, please ask again",
"orders": 2
}
]
}
}
}
Update Template Interface
Request Address
- PUT /v1/datumTemplates/:id
Request Parameters
Request Fields
path | Type | Optional | Description |
---|
id | Integer | false | ID |
name | String | false | Template Name |
robotId | Integer | false | Robot ID. |
orders | Integer | true | Sorting |
parentId | Integer | false | Inherited Template (If it is a top-level template, it is 0. For non-top-level templates, the parent template ID needs to be passed) |
remark | String | true | Template Description (Description length cannot exceed 255 characters) |
questionAndAnswerSet | Integer | false | Template QA Setting (0. None, 1. Default Reply, 2. Clarification, 4. Recommendation, 8. Search) |
similarList[] | String | true | Alias |
attributes | Array | true | Attribute List |
attributes[].id | Integer | false | ID |
attributes[].robotId | Integer | false | Robot ID |
attributes[].templateId | Integer | false | Template ID |
attributes[].name | String | true | Attribute Name |
attributes[].allowInherited | Integer | false | Whether to Allow Inheritance (0. Not Inherited, 1. Inheritable) |
attributes[].answer | String | true | Attribute Value() |
attributes[].askBack | String | true | Prompt for Clarification |
attributes[].askBackFlag | Integer | true | Prompt for Clarification Type |
attributes[].switchStatus | Integer | false | Attribute Switch (0. Off, 1. On) |
attributes[].changeType | Integer | false | Modification Type (0. No Modification, 1. Add, 2. Update, 3. Delete) |
attributes[].similarList[] | String | true | Attribute Alias |
attributes[].expressionList[] | String | true | Attribute Expression |
datumDefaultAnswer | Array | true | Default Reply from Data Base |
datumDefaultAnswer.id | Integer | false | ID |
datumDefaultAnswer.robotId | Integer | false | Robot ID |
datumDefaultAnswer.templateId | Integer | false | Template ID |
datumDefaultAnswer.answerType | Integer | false | Reply Type (1. Partial Attributes, 2. Trigger Attribute Clarification, 3. All Attributes) |
datumDefaultAnswer.attributeIdList[] | Integer | true | Attribute ID (Required when reply type is not all attributes) |
datumRecommendation | Array | true | Knowledge Recommendation |
datumRecommendation.id | Integer | false | ID |
datumRecommendation.robotId | Integer | false | Robot ID |
datumRecommendation.templateId | Integer | false | Template ID |
datumRecommendation.noResultContent | String | false | Response when there is no result |
datumRecommendation.recommendationNumber | Integer | false | Number of recommended knowledge points |
datumSearch | Array | true | Knowledge Search |
datumSearch.id | Integer | false | ID |
datumSearch.robotId | Integer | false | Robot ID |
datumSearch.templateId | Integer | false | Template ID |
datumSearch.noResultContent | String | false | Response when there is no result |
datumSearch.recommendationNumber | Integer | false | Number of recommended knowledge points |
datumSearch.strategies | Array | true | Knowledge Search Strategies |
datumSearch.strategies[].id | Integer | false | ID |
datumSearch.strategies[].robotId | Integer | false | Robot ID |
datumSearch.strategies[].templateId | Integer | false | Template ID |
datumSearch.strategies[].datumSearchId | Integer | false | Knowledge Search ID |
datumSearch.strategies[].name | String | false | Strategy Name |
datumSearch.strategies[].remark | String | true | Strategy Description |
datumSearch.strategies[].clarificationAskContent | String | false | Search Strategy Prompt |
datumSearch.strategies[].retrievalTarget | Integer | false | Retrieval Target 1. Get Attribute 2. Get Knowledge |
datumSearch.strategies[].attributeId | Integer | true | Attribute ID (Required when retrieval target is to get attribute (only one can be selected), not required when getting knowledge, retrieve all knowledge points) |
datumSearch.strategies[].clarificationContent | String | true | Clarification Speech |
datumSearch.strategies[].clarificationRounds | String | true | Clarification Rounds |
datumSearch.strategies[].failureContent | String | true | Failure Speech |
datumClarify | Object | true | Knowledge Clarification |
datumClarify.robotId | Integer | true | Robot ID |
datumClarify.templateId | Integer | true | Template ID |
datumClarify.recommendationNumber | Integer | true | Number of Knowledge Recommendations |
datumClarify.noResultContent | String | true | Response when there is no result |
datumClarify.clarifyType | Integer | true | Search Strategy 1 Attribute Clarification 2 Strategy Follow-up Question |
datumClarify.askType | String | true | Search Type 1 Priority 2 Intelligent Search |
datumClarify.strategies | Array | true | Strategy Name |
datumClarify.strategies[].robotId | Integer | true | Robot ID |
datumClarify.strategies[].templateId | Integer | true | Template ID |
datumClarify.strategies[].datumClarifyId | Integer | true | Knowledge Clarification ID |
datumClarify.strategies[].name | String | true | Strategy Name |
datumClarify.strategies[].remark | String | true | Strategy Description |
datumClarify.strategies[].clarificationAskContent | String | true | Search Strategy Prompt |
datumClarify.strategies[].retrievalTarget | Integer | true | Retrieval Target 1: Get Attribute 2: Get Knowledge |
datumClarify.strategies[].attributeId | Integer | true | Attribute ID Required when retrieval target is to get attribute (only one can be selected), not required when getting knowledge, retrieve all knowledge points |
datumClarify.strategies[].alternativePushContent | Object | true | Alternative Push Switch |
datumClarify.strategies[].alternativePushStatus.chosen | Integer | true | Selected Style 0 1 2 |
datumClarify.strategies[].alternativePushStatus.style | String | true | Style Template |
datumClarify.strategies[].alternativePushStatus.labelList | Array | true | Label List |
datumClarify.strategies[].alternativePushStatus.labelList[].id | Integer | true | Label ID |
datumClarify.strategies[].alternativePushStatus.labelList[].name | Integer | true | Label Name |
datumClarify.strategies[].alternativePushStatus.labelList[].content | Integer | true | Label Content |
datumClarify.strategies[].clarificationContent | String | true | Clarification Speech |
datumClarify.strategies[].clarificationRounds | String | true | Clarification Rounds |
datumClarify.strategies[].failureContent | String | true | Failure Speech |
datumClarify.strategies[].orders | Integer | true | Sorting Priority |
Request Result
Path | Type | Description |
---|
code | Integer | Status Code |
message | String | Return Message |
visible | Boolean | |
data | Object | Return Content |
Example
$ curl 'https://km.udesk.cn/api/v1/datumTemplates/56?email=admin@udesk.cn×tamp=1559022283&sign=aa8164470dff8468e6129c1e7d5767651cdedd7c' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -
d '{
"id":56,
"name": "Tiny Template",
"robotId": 83,
"similarList": ["Template Alias"],
"parentId": 21,
"remark": "Template Description",
"questionAndAnswerSet": 15,
"attributes": [{
"name": "Template Attribute 2",
"similarList": ["Template Attribute 2 Alias", "Template Attribute 2 Alias 2"],
"allowInherited": 1,
"answer": "<p>Template Attribute 2 Value</p>",
"askBack": "Which do you want to know about for testing the creation of Template Attribute 2?",
"askBackFlag": 0,
"switchStatus": 1,
"expressionList": ["Hello", "haha"],
"changeType": 1
}, {
"name": "Template Attribute",
"similarList": ["Template Attribute Alias", "Template Attribute Alias 2"],
"allowInherited": 1,
"answer": "<p>Template Attribute Value</p>",
"askBack": "Which do you want to know about for testing the creation of Template Attribute?",
"askBackFlag": 0,
"switchStatus": 1,
"expressionList": ["Template Attribute Expression", "Template Attribute Expression 2"],
"changeType": 1
}],
"datumDefaultAnswer": {
"answerType": 3
},
"datumRecommendation": {
"noResultContent": "Sorry, no knowledge point found based on your criteria, please rephrase",
"recommendationNumber": 3
},
"datumSearch": {
"noResultContent": "Sorry, no knowledge point found based on your criteria, please rephrase",
"recommendationNumber": 3,
"strategies": [{
"name": "Strategy 2",
"remark": "Strategy 2 Description",
"clarificationAskContent": "Yes, Strategy 2 Description",
"retrievalTarget": 2,
"clarificationContent": "Strategy 2 Clarification Tree",
"clarificationRounds": 2,
"failureContent": "Sorry, search failed, please rephrase"
}, {
"name": "Search Strategy",
"remark": "Search Strategy Description",
"clarificationAskContent": "Search Query",
"retrievalTarget": 2,
"clarificationContent": "Clarification Tree",
"clarificationRounds": 2,
"failureContent": "Sorry, search failed, please rephrase"
}]
}
}'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"exception":null,
"paging":null,
"data": null
}
Get Template List Interface
Request Address
- POST /v1/datumTemplates/search
Request Parameters
Request Fields
Path | Type | Optional | Description |
---|
pageNum | Integer | true | Page Number |
pageSize | Integer | true | Number per Page |
robotId | Integer | false | Robot ID |
leafFlag | Integer | true | Template Type (1. Leaf Template 2. All Templates) (default is leaf template) |
keyword | String | true | Keyword Search |
Request Result
Path | Type | Description |
---|
code | Integer | Status Code |
message | String | Return Message |
data | Object | Return Content |
data[].id | Integer | Template ID |
data[].name | String | Template Name |
data[].robotId | Integer | Robot ID |
data[].parentId | Integer | Parent Template ID |
data[].leafFlag | Integer | Whether it is a leaf template (0. No, 1. Yes) |
data[].rootId | Integer | Root Template ID |
data[].remark | String | Template Description |
data[].questionAndAnswerSet | Integer | Template QA Setting (0. None, 1. Default Reply, 2. Clarification, 4. Recommendation, 8. Search) |
data[].similarList[] | String | Template Alias |
Example
$ curl 'https://km.udesk.cn/api/v1/datumTemplates/search?email=admin@udesk.cn×tamp=1578367138&sign=4e6cfa92d0ef5f5ed214e7dfa4be766cc1b86254' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
"pageNum":1,
"pageSize":10,
"robotId":83,
"keyword":"Country"
}'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"paging": {
"pageNum": 1,
"pageSize": 10,
"total": 1
},
"data": [
{
"id": 127,
"name": "Country",
"robotId": 83,
"parentId": 0,
"remark": "",
"questionAndAnswerSet": 15,
"leafFlag": 1,
"rootId": 127,
"similarList": []
}
]
}
Knowledge Deletion Interface
Request Address
Request Parameters
Request parameters
Parameter | Type | Optional | Description |
---|
id | Integer | false | Knowledge ID |
Request Result
- None, successful deletion, HTTP response code is 204
Example
$ curl 'https://km.udesk.cn/api/v1/datums/2?email=admin@udesk.cn×tamp=1573026139&sign=31322f38618d50ee671ef073305ac9917e652374' -i -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'
Get Knowledge Details Interface
Request Address
Request Parameters
Request fields
Path | Type | Optional | Description |
---|
id | Integer | false | Knowledge ID |
Request Result
Path | Type | Description |
---|
code | Integer | Execution result code |
message | String | Execution result explanation |
data | Object | Knowledge information |
data[].id | Array | Knowledge ID |
data[].robotId | Integer | Robot ID |
data[].name | String | Knowledge Name |
data[].displayName | String | Knowledge Display Name |
data[].templateId | Integer | Template ID |
data[].templateName | String | Template Name |
data[].similarList[] | String | Synonyms |
data[].categoryId | Integer | Category ID |
data[].orders | Integer | Sort ID |
data[].attributes | Array | Knowledge attribute values |
data[].attributes[].id | Integer | ID |
data[].attributes[].name | String | Attribute Name |
data[].attributes[].robotId | Integer | Robot ID |
data[].attributes[].datumId | Integer | Knowledge ID |
data[].attributes[].templateId | Integer | Template ID |
data[].attributes[].templateAttributeId | Integer | Template Attribute ID |
data[].attributes[].switchStatus | Integer | Whether it is open (0. Off, 1. On) |
data[].attributes[].answer | String | Rich text answer |
data[].attributes[].srcType | Integer | Source type (0. Customized, 1. Inherit template attribute value) |
Example
$ curl 'https://km.udesk.cn/api/v1/datums/2?email=admin@udesk.cn×tamp=1559022283&sign=aa8164470dff8468e6129c1e7d5767651cdedd7c' -i -X GET -H 'Content-Type: application/json' -H 'Accept: application/json'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"data": {
"id": 1,
"name": "Udesk Test Name",
"similarList": [],
"robotId": 83,
"templateId": 45,
"templateName": "Udesk Test Template",
"categoryId": 23,
"orders": null,
"category": null,
"attributes": [
{
"id": 330,
"name": "Udesk Knowledge Name",
"robotId": 83,
"datumId": 1,
"templateId": 45,
"templateAttributeId": 53,
"switchStatus": null,
"answer": "Udesk Knowledge Answer",
"srcType": 0
}
]
}
}
Create Knowledge Interface
Request Address
Request Parameters
Request fields
Path | Type | Optional | Description |
---|
robotId | Integer | false | Robot ID |
name | String | false | Knowledge Name |
templateId | Integer | false | Template ID |
categoryId | Integer | false | Category ID |
displayName | String | false | Knowledge Display Name |
Request Result
Path | Type | Description |
---|
code | Integer | Execution result code |
message | String | Execution result explanation |
data | Object | Knowledge information |
data[].id | Array | Knowledge ID |
data[].robotId | Integer | Robot ID |
data[].name | String | Knowledge Name |
data[].displayName | String | Knowledge Display Name |
data[].templateId | Integer | Template ID |
data[].templateName | String | Template Name |
data[].similarList[] | String | Synonyms |
data[].categoryId | Integer | Category ID |
data[].orders | Integer | Sort ID |
data[].attributes | Array | Knowledge attribute values |
data[].attributes[].id | Integer | Knowledge attribute value ID |
data[].attributes[].name | String | Attribute Name |
data[].attributes[].robotId | Integer | Robot ID |
data[].attributes[].datumId | Integer | Knowledge ID |
data[].attributes[].templateId | Integer | Template ID |
data[].attributes[].templateAttributeId | Integer | Template Attribute ID |
data[].attributes[].switchStatus | Integer | Whether it is open (0. Off, 1. On) |
data[].attributes[].answer | String | Rich text answer |
data[].attributes[].srcType | Integer | Source type (0. Customized, 1. Inherit template attribute value) |
Example
curl 'http://www.udesk.cn/v1/datums?email=admin@udesk.cn×tamp=1573024943&sign=b5236e4bc2e73e529d544ace070f8c31369ca9dd' -i -X PUT -H 'Content-Type: application/json' -d '{
"name":"Create New Knowledge",
"robotId":83,
"templateId":56,
"categoryId":23
}'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"data": {
"id": 3,
"name": "Udesk Test Knowledge",
"similarList": [],
"robotId": 83,
"templateId": 56,
"templateName": "Udesk Test Template",
"categoryId": 23,
"orders": 1,
"category": 23,
"attributes": [
{
"id": 1,
"name": "Complaints and Suggestions",
"robotId": 83,
"datumId": 3,
"templateId": 56,
"templateAttributeId": 33,
"switchStatus": null,
"answer": null,
"srcType": null
},
{
"id": 2,
"name": "Template Attribute 2",
"robotId": 83,
"datumId": 3,
"templateId": 56,
"templateAttributeId": 135,
"switchStatus": null,
"answer": "<p>Template Attribute 2 Value</p>",
"srcType": 1
}
]
}
}
Request Failure Reasons
{
"code": 400,
"message": "{Specific Exception Information}",
"visible": false
}
message | description |
---|
"Data has been deleted or does not exist" | The knowledge point corresponding to the ID does not exist |
Update Knowledge Interface
Request Address
Request Parameters
Request fields
Path | Type | Optional | Description |
---|
robotId | Integer | false | Robot ID |
name | String | false | Knowledge Name |
displayName | String | false | Knowledge Display Name |
templateId | Integer | false | Template ID |
templateName | String | false | Template Name |
similarList[] | String | true | Synonyms |
categoryId | Integer | false | Category ID |
orders | Integer | false | Sort ID |
attributes | Array | true | Knowledge attribute values (Knowledge attribute values can only be modified, not added or deleted, obtained through knowledge details) |
attributes[].id | Integer | false | ID |
attributes[].name | String | false | Attribute Name |
attributes[].robotId | Integer | false | Robot ID |
attributes[].datumId | Integer | false | Knowledge ID |
attributes[].templateId | Integer | false | Template ID |
attributes[].templateAttributeId | Integer | false | Template Attribute ID |
attributes[].switchStatus | Integer | false | Whether it is open (0. Off, 1. On) |
attributes[].answer | String | true | Rich text answer |
attributes[].srcType | Integer | false | Source type (0. Customized, 1. Inherit template attribute value) (If the attribute has no default value or is different from the default value of the attribute, srcType is 0) |
Request Result
Path | Type | Description |
---|
code | Integer | Status code |
message | String | Return message |
data | Object | Return content |
Example
$ curl 'https://km.udesk.cn/api/v1/datums/3?email=admin@udesk.cn×tamp=1559022283&sign=aa8164470dff8468e6129c1e7d5767651cdedd7c' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
"id": 3,
"name": "Updated New Knowledge",
"similarList": [],
"robotId": 83,
"templateId": 56,
"templateName": null,
"categoryId": 23,
"orders": null,
"category": null,
"attributes": [
{
"id": 1,
"name": "Complaints and Suggestions",
"robotId": 83,
"datumId": 3,
"templateId": 56,
"templateAttributeId": 33,
"switchStatus": null,
"answer": null,
"srcType": null
},
{
"id": 2,
"name": "Template Attribute 2",
"robotId": 83,
"datumId": 3,
"templateId": 56,
"templateAttributeId": 135,
"switchStatus": null,
"answer": "<p>Template Attribute 2 Value</p>",
"srcType": 1
}
]
}'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"data": {
"id": 3,
"name": "Updated New Knowledge",
"similarList": [],
"robotId": 83,
"templateId": 56,
"templateName": null,
"categoryId": 23,
"orders": null,
"category": null,
"attributes": [
{
"id": 1,
"name": "Complaints and Suggestions",
"robotId": 83,
"datumId": 3,
"templateId": 56,
"templateAttributeId": 33,
"switchStatus": null,
"answer": null,
"srcType": null
},
{
"id": 2,
"name": "Template Attribute 2",
"robotId": 83,
"datumId": 3,
"templateId": 56,
"templateAttributeId": 135,
"switchStatus": null,
"answer": "<p>Template Attribute 2 Value</p>",
"srcType": 1
}
]
}
}
Get Category List Interface
Request Address
- POST /v1/datumCategories/search
Request Parameters
Request fields
Path | Type | Optional | Description |
---|
pageNum | Integer | true | Page number |
pageSize | Integer | true | Number of items per page |
robotId | Integer | false | Robot ID |
keyword | String | true | Keyword search |
Request Result
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[].robotId | Integer | Robot ID |
data[].parentId | Integer | Parent Category ID |
Example
$ curl 'https://km.udesk.cn/api/v1/datumCategories/search?email=admin@udesk.cn×tamp=1578367614&sign=5548fd5ad06564b64f6925aeed99ec937d17f444' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
"pageNum":1,
"pageSize":10,
"robotId":83,
"keyword":"a"
}'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"paging": {
"pageNum": 1,
"pageSize": 10,
"total": 1
},
"data": [
{
"id": 26,
"name": "ablity",
"robotId": 83,
"parentId": 9
}
]
}