logo

Entity Deletion Interface

Request Address

  • DELETE /v1/entity/:id

Request Parameters

Request parameters

ParameterTypeOptionalDescription
idIntegerfalseEntity ID.
forceIntegertrueWhether to force deletion 0: No, 1: Yes (default is 0).

Request Result

PathTypeDescription
codeIntegerExecution result code
messageStringExecution result description

Example

$ curl 'https://km.udesk.cn/api/v1/entity/12?force=0&email=admin@udesk.cn&timestamp=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

  • PUT /v1/entity/:id

Request Parameters

Request fields

PathTypeOptionalDescription
robotIdIntegerfalseRobot ID.
nameStringfalseEntity name.
apiNameStringfalseAPI name of the entity (API name can only be letters, numbers, or underscores).
remarkStringtrueEntity description (description length cannot exceed 255 characters).
regexStringtrueEntity regex value.
valueListArraytrueEntity value list.
valueList[].idIntegertrueEntity value ID
valueList[].originalValueStringtrueEntity value name
valueList[].changeTypeIntegertrueModification status (0. Not modified, 1. Added, 2. Modified, 3. Deleted)
valueList[].similarValueListArraytrueArray of entity value synonyms
valueList[].similarValueList[]StringtrueSynonyms of entity values

Request Result

PathTypeDescription
codeIntegerExecution result code
messageStringExecution result description
dataObjectEntity information
data[].idIntegerEntity ID.
data[].robotIdIntegerRobot ID of the entity.
data[].nameStringEntity name.
data[].apiNameStringAPI name of the entity.
data[].typeIntegerType of entity 1: Custom 2: System.
data[].statusIntegerEntity status 0: Disabled 1: Enabled.
data[].regexStringEntity regex value.
data[].sysEntityIdentifierStringEntity system identifier descriptor.
data[].remarkStringEntity description.
data[].ordersIntegerEntity sorting.
data[].valueListArrayEntity value list.
data[].valueList[].idIntegerEntity value ID
data[].valueList[].originalValueStringEntity value name
data[].valueList[].similarValueListArrayArray of synonyms of entity values
data[].valueList[].similarValueList[]StringSynonyms

Example

$ curl 'https://km.udesk.cn/api/v1/entity/12?email=admin@udesk.cn&timestamp=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

  • POST /v1/entity

Request Parameters

Request fields

PathTypeOptionalDescription
robotIdIntegerfalseRobot ID.
nameStringfalseEntity name.
apiNameStringfalseEntity API name (API name can only be letters, numbers, or underscores).
regexStringtrueEntity regex value.
remarkStringtrueEntity description (description length cannot exceed 255 characters).

Request Result

PathTypeDescription
codeIntegerExecution result code
messageStringExecution result description
dataObjectEntity information
data[].idIntegerEntity ID.
data[].robotIdIntegerRobot ID of the entity.
data[].nameStringEntity name.
data[].apiNameStringEntity API name.
data[].typeIntegerEntity type 1: Custom 2: System.
data[].statusIntegerEntity status 0: Disabled 1: Enabled.
data[].regexStringEntity regex value.
data[].sysEntityIdentifierStringEntity system identifier descriptor.
data[].remarkStringEntity description.
data[].ordersIntegerEntity sorting.
data[].valueListArrayEntity value list.
data[].valueList[].idIntegerEntity value ID
data[].valueList[].originalValueStringEntity value name
data[].valueList[].changeTypeIntegerEntity modification type (0. Not modified, 1. Added, 2. Modified, 3. Deleted)
data[].valueList[].similarValueListArrayArray of entity value synonyms
data[].valueList[].similarValueList[]StringSynonyms

Example

$ curl 'https://km.udesk.cn/api/v1/entity?email=admin@udesk.cn&timestamp=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
}
messagedescription
"{Specific Field}...."{Specific Field} {Error Reason}

Entity Enable/Disable Interface

Request Address

  • PUT /v1/entity/:id/status/:status

Request Parameters

Request fields

pathTypeOptionalDescription
idIntegerfalseEntity ID.
statusIntegerfalseEntity status 0: Disabled, 1: Enabled.

Request Result

PathTypeDescription
codeIntegerExecution result code
messageStringExecution result description

Example

$ curl 'https://km.udesk.cn/api/v1/entity/12/status/1?email=admin@udesk.cn&timestamp=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

  • GET /v1/entity/:id

Request Parameters

Request fields

pathTypeOptionalDescription
idIntegerfalseEntity ID.

Request Result

PathTypeDescription
codeIntegerExecution result code
messageStringExecution result description
dataObjectEntity information
data[].idIntegerEntity ID.
data[].robotIdIntegerRobot ID.
data[].nameStringEntity name.
data[].apiNameStringEntity API name.
data[].typeIntegerEntity type 1: Custom 2: System.
data[].statusIntegerEntity status 0: Disabled 1: Enabled.
data[].regexStringEntity regex value.
data[].sysEntityIdentifierStringSystem identifier descriptor.
data[].remarkStringEntity description.
data[].ordersIntegerEntity sorting.
data[].valueListArrayEntity value list.
data[].valueList[].idIntegerEntity value ID
data[].valueList[].originalValueStringEntity value name
data[].valueList[].similarValueListArrayArray of synonyms of entity values
data[].valueList[].similarValueList[]StringSynonyms

Example

$ curl 'https://km.udesk.cn/api/v1/entity/2850?email=admin@udesk.cn&timestamp=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
}
messagedescription
"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

ParameterTypeOptionalDescription
robotIdIntegerfalseRobot ID.
pageNumIntegertruePage number (default is 1).
pageSizeIntegertrueNumber of items per page (default is 10, maximum is 100).
keywordIntegertrueSearch keyword.
statusIntegertrueEntity status 0: Disabled 1: Enabled.

Request Result

PathTypeDescription
codeIntegerExecution result code
messageStringExecution result description
dataObjectEntity list information
data[].idIntegerEntity ID
data[].robotIdIntegerRobot ID,
data[].nameStringEntity name
data[].apiNameStringEntity API name
data[].typeIntegerEntity type 1: Custom 2: System.
data[].statusIntegerEntity status 0: Disabled 1: Enabled.
data[].regexStringEntity regex value.
data[].sysEntityIdentifierStringSystem identifier descriptor.
data[].remarkStringEntity description.
data[].ordersIntegerEntity sorting.
data[].valueListArrayEntity value list.
data[].valueList[].idIntegerEntity value ID
data[].valueList[].originalValueStringEntity value name
data[].valueList[].similarValueListArrayArray of synonyms of entity values
data[].valueList[].similarValueList[]StringSynonyms

Example

$ curl 'https://km.udesk.cn/api/v1/entity/robot/83?pageNum=1&pageSize=15&keyword="EntityName"&status=1&&email=admin@udesk.cn&timestamp=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

messagedescription
Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'Exception in value conversion from string to integer.