Entity Deletion Interface
Request Address
Request Parameters
Request parameters
Parameter | Type | Optional | Description |
---|
id | Integer | false | Entity ID. |
force | Integer | true | Whether to force deletion 0: No, 1: Yes (default is 0). |
Request Result
Path | Type | Description |
---|
code | Integer | Execution result code |
message | String | Execution result description |
Example
$ curl 'https://km.udesk.cn/api/v1/entity/12?force=0&email=admin@udesk.cn×tamp=1559022283&sign=aa8164470dff8468e6129c1e7d5767651cdedd7c' -i -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'
Response
{
"code": 200,
"message": "OK",
"visible": false
}
Entity Update Interface
Request Address
Request Parameters
Request fields
Path | Type | Optional | Description |
---|
robotId | Integer | false | Robot ID. |
name | String | false | Entity name. |
apiName | String | false | API name of the entity (API name can only be letters, numbers, or underscores). |
remark | String | true | Entity description (description length cannot exceed 255 characters). |
regex | String | true | Entity regex value. |
valueList | Array | true | Entity value list. |
valueList[].id | Integer | true | Entity value ID |
valueList[].originalValue | String | true | Entity value name |
valueList[].changeType | Integer | true | Modification status (0. Not modified, 1. Added, 2. Modified, 3. Deleted) |
valueList[].similarValueList | Array | true | Array of entity value synonyms |
valueList[].similarValueList[] | String | true | Synonyms of entity values |
Request Result
Path | Type | Description |
---|
code | Integer | Execution result code |
message | String | Execution result description |
data | Object | Entity information |
data[].id | Integer | Entity ID. |
data[].robotId | Integer | Robot ID of the entity. |
data[].name | String | Entity name. |
data[].apiName | String | API name of the entity. |
data[].type | Integer | Type of entity 1: Custom 2: System. |
data[].status | Integer | Entity status 0: Disabled 1: Enabled. |
data[].regex | String | Entity regex value. |
data[].sysEntityIdentifier | String | Entity system identifier descriptor. |
data[].remark | String | Entity description. |
data[].orders | Integer | Entity sorting. |
data[].valueList | Array | Entity value list. |
data[].valueList[].id | Integer | Entity value ID |
data[].valueList[].originalValue | String | Entity value name |
data[].valueList[].similarValueList | Array | Array of synonyms of entity values |
data[].valueList[].similarValueList[] | String | Synonyms |
Example
$ curl 'https://km.udesk.cn/api/v1/entity/12?email=admin@udesk.cn×tamp=1559016375&sign=7f31519fd01b85d4043b9413d1fad225718eb914' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
"apiName": "api",
"name": "Updated Entity Name",
"regex": "/d+",
"remark": "Updated description",
"robotId": 83,
"valueList": [
{
"changeType": 2,
"id": 23,
"originalValue": "Updated Entity Value",
"similarValueList": [
"Synonym"
]
}
]
}'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"data": {
"id": 12,
"robotId": 83,
"name": "Updated Entity Name",
"apiName": "api",
"type": 1,
"status": 0,
"regex": "/d+",
"sysEntityIdentifier": null,
"remark": "Updated description",
"orders": 15,
"valueList": [
{
"id": 23,
"originalValue": "Updated Entity Value",
"similarValueList": [
"Synonym"
]
}
]
}
}
Entity Creation Interface
Request Address
Request Parameters
Request fields
Path | Type | Optional | Description |
---|
robotId | Integer | false | Robot ID. |
name | String | false | Entity name. |
apiName | String | false | Entity API name (API name can only be letters, numbers, or underscores). |
regex | String | true | Entity regex value. |
remark | String | true | Entity description (description length cannot exceed 255 characters). |
Request Result
Path | Type | Description |
---|
code | Integer | Execution result code |
message | String | Execution result description |
data | Object | Entity information |
data[].id | Integer | Entity ID. |
data[].robotId | Integer | Robot ID of the entity. |
data[].name | String | Entity name. |
data[].apiName | String | Entity API name. |
data[].type | Integer | Entity type 1: Custom 2: System. |
data[].status | Integer | Entity status 0: Disabled 1: Enabled. |
data[].regex | String | Entity regex value. |
data[].sysEntityIdentifier | String | Entity system identifier descriptor. |
data[].remark | String | Entity description. |
data[].orders | Integer | Entity sorting. |
data[].valueList | Array | Entity value list. |
data[].valueList[].id | Integer | Entity value ID |
data[].valueList[].originalValue | String | Entity value name |
data[].valueList[].changeType | Integer | Entity modification type (0. Not modified, 1. Added, 2. Modified, 3. Deleted) |
data[].valueList[].similarValueList | Array | Array of entity value synonyms |
data[].valueList[].similarValueList[] | String | Synonyms |
Example
$ curl 'https://km.udesk.cn/api/v1/entity?email=admin@udesk.cn×tamp=1559016113&sign=f16d7f6fcc3fbab73855f4510cd4904f0f60e258' -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
"robotId" : 83,
"name" : "New Entity Name",
"apiName":"api",
"remark":"New description"
}'
Response
{
"code": 200,
"message": "OK",
"visible": false,
"exception": null,
"paging": null,
"data": {
"id": 2850,
"robotId": 83,
"name": "New Entity Name",
"apiName": "api",
"type": 1,
"status": null,
"regex": null,
"sysEntityIdentifier": null,
"remark": "New description",
"orders": null,
"valueList": null
}
}
Failure Reasons for Request
{
"code": 400,
"message": "{Specific exception information}",
"visible": false
}
message | description |
---|
"{Specific Field}...." | {Specific Field} {Error Reason} |
Entity Enable/Disable Interface
Request Address
- PUT /v1/entity/:id/status/:status
Request Parameters
Request fields
path | Type | Optional | Description |
---|
id | Integer | false | Entity ID. |
status | Integer | false | Entity status 0: Disabled, 1: Enabled. |
Request Result
Path | Type | Description |
---|
code | Integer | Execution result code |
message | String | Execution result description |
Example
$ curl 'https://km.udesk.cn/api/v1/entity/12/status/1?email=admin@udesk.cn×tamp=1559022283&sign=aa8164470dff8468e6129c1e7d5767651cdedd7c' -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json'
Response
{
"code": 200,
"message": "OK",
"visible": false
}
Entity Details Retrieval Interface
Request Address
Request Parameters
Request fields
path | Type | Optional | Description |
---|
id | Integer | false | Entity ID. |
Request Result
Path | Type | Description |
---|
code | Integer | Execution result code |
message | String | Execution result description |
data | Object | Entity information |
data[].id | Integer | Entity ID. |
data[].robotId | Integer | Robot ID. |
data[].name | String | Entity name. |
data[].apiName | String | Entity API name. |
data[].type | Integer | Entity type 1: Custom 2: System. |
data[].status | Integer | Entity status 0: Disabled 1: Enabled. |
data[].regex | String | Entity regex value. |
data[].sysEntityIdentifier | String | System identifier descriptor. |
data[].remark | String | Entity description. |
data[].orders | Integer | Entity sorting. |
data[].valueList | Array | Entity value list. |
data[].valueList[].id | Integer | Entity value ID |
data[].valueList[].originalValue | String | Entity value name |
data[].valueList[].similarValueList | Array | Array of synonyms of entity values |
data[].valueList[].similarValueList[] | String | Synonyms |
Example
$ curl 'https://km.udesk.cn/api/v1/entity/2850?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,
"exception": null,
"paging": null,
"data": {
"id": 2850,
"robotId": 83,
"name": "Entity Name",
"apiName": "api",
"type": 1,
"status": 1,
"regex": null,
"sysEntityIdentifier": null,
"remark": "Description",
"orders": null,
"valueList": [
{
"id": 213984,
"originalValue": "123123",
"similarValueList": [
"b",
"a"
]
}
]
}
}
Failure Reasons for Request
{
"code": 400,
"message": "{Specific exception information}",
"visible": false
}
message | description |
---|
"Entity not exists" | The entity corresponding to the ID in the parameters does not exist |
Entity List Retrieval Interface
Request Address
- GET /v1/entity/robot/{robotId}
Request Parameters
Request parameters
Parameter | Type | Optional | Description |
---|
robotId | Integer | false | Robot ID. |
pageNum | Integer | true | Page number (default is 1). |
pageSize | Integer | true | Number of items per page (default is 10, maximum is 100). |
keyword | Integer | true | Search keyword. |
status | Integer | true | Entity status 0: Disabled 1: Enabled. |
Request Result
Path | Type | Description |
---|
code | Integer | Execution result code |
message | String | Execution result description |
data | Object | Entity list information |
data[].id | Integer | Entity ID |
data[].robotId | Integer | Robot ID, |
data[].name | String | Entity name |
data[].apiName | String | Entity API name |
data[].type | Integer | Entity type 1: Custom 2: System. |
data[].status | Integer | Entity status 0: Disabled 1: Enabled. |
data[].regex | String | Entity regex value. |
data[].sysEntityIdentifier | String | System identifier descriptor. |
data[].remark | String | Entity description. |
data[].orders | Integer | Entity sorting. |
data[].valueList | Array | Entity value list. |
data[].valueList[].id | Integer | Entity value ID |
data[].valueList[].originalValue | String | Entity value name |
data[].valueList[].similarValueList | Array | Array of synonyms of entity values |
data[].valueList[].similarValueList[] | String | Synonyms |
Example
$ curl 'https://km.udesk.cn/api/v1/entity/robot/83?pageNum=1&pageSize=15&keyword="EntityName"&status=1&&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,
"paging": {
"pageNum": 1,
"pageSize": 15,
"total": 2
},
"data": [
{
"id": 179,
"robotId": 83,
"name": "CityEntity",
"apiName": "sys_city",
"type": 2,
"status": 1,
"regex": null,
"sysEntityIdentifier": "All cities and counties in China",
"remark": null,
"orders": 4,
"valueList": null
}
]
}
Failure Reasons
message | description |
---|
Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer' | Exception in value conversion from string to integer. |