Learn how to delete entities
Use the DELETE method to remove an entity from active list.
DELETE {Host Name}/api/v1/base/{EntityType}/{ID of Entity}
where {Host Name} is derived from GetCompanyWsdkUrlCommand.Url, and
{EntityType} is a class that is derived from RemovableCorrigoEntity parent class, and
{ID of Entity} is the integer value of non-archived Entity within the targeted Company
Contact Example
Contacts are frequently removed from the system as access to Customer Portal is revoked. Note that RestoreCommand may be used to reverse this operation.
DELETE <<AM Host Name>>/api/v1/base/Contact/20378 HTTP/1.1
Accept-Encoding: gzip,deflate
CompanyName: <<Sample Company>>
Content-Type: application/json
Authorization: Bearer eyJBdXRoZW50aWNhdGlvblR5cGUiOiJCZWFyZXIiLCJOYW1lQ2xhaW1UeXBlIjoiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZSIsIlJvbGVDbGFpbVR5cGUiOiJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIiwiQ2xhaW1zIjpbeyJUeXBlIjoiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZSIsIlZhbHVlIjoiY2VhcGljbGllbnQuMS4xODY4LmQxZWYiLCJWYWx1ZVR5cGUiOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSNzdHJpbmciLCJJc3N1ZXIiOiJMT0NBTCBBVVRIT1JJVFkiLCJPcmlnaW5hbElzc3VlciI6IkxPQ0FMIEFVVEhPUklUWSJ9LHsiVHlwZSI6InVybjpvYXV0aDpzY29wZSIsIlZhbHVlIjoiIiwiVmFsdWVUeXBlIjoiaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEjc3RyaW5nIiwiSXNzdWVyIjoiTE9DQUwgQVVUSE9SSVRZIiwiT3JpZ2luYWxJc3N1ZXIiOiJMT0NBTCBBVVRIT1JJVFkifSx7IlR5cGUiOiJBdWQiLCJWYWx1ZSI6IjE4NjgiLCJWYWx1ZVR5cGUiOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSNzdHJpbmciLCJJc3N1ZXIiOiJMT0NBTCBBVVRIT1JJVFkiLCJPcmlnaW5hbElzc3VlciI6IkxPQ0FMIEFVVEhPUklUWSJ9XSwiUHJvcGVydGllcyI6eyJEaWN0aW9uYXJ5Ijp7Ii5pc3N1ZWQiOiJGcmksIDEwIERlYyAyMDIxIDAwOjIzOjQ0IEdNVCIsIi5leHBpcmVzIjoiRnJpLCAxMCBEZWMgMjAyMSAwMDo0Mzo0NCBHTVQifX19<---->VsnD9Qc5CkNPdakJ2TZ5qQhygiDp59HPJAxVJDZZ4SsTKqPC3D2Fqd_U3CmrT4ULSk0FbE7aZ61dHpYYpJPlRXxwT0Urgv1lZgqwtv0h7ApwqxGALB9UlZTujLF2ASFCmoNYe250TagbVZDfLh1rR5UWpC0usJoiPVfDynL-p-S6rnhLaPqrRiku2kI58zA0NME19da90bV3f2-WFTnr5cNNjs1UFj85xOiQd0xgMcyIoJr4yzJiMBiyr2gTSK4vdQVYPoBRfTQvxtDBbw7els3hlcKbU98gvBeQkQ2eEW18kTdgOyHg77I7UUZ5VFpNiz6R_ORBsUUbfSUW0mAWrg
Content-Length: 0
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/16.0.1)
{
"EntitySpecifier" : {
"EntityType" : "Contact",
"Id" : 20378
}
}
WorkOrder Example
WorkOrder entities cannot be deleted from the Corrigo Enterprise application, resulting in an ERROR_CODE_1000 error message if attempted.
DELETE <<AM Host Name>>/api/v1/base/WorkOrder/37 HTTP/1.1
Accept-Encoding: gzip,deflate
CompanyName: <<Sample Company>>
Content-Type: application/json
Authorization: Bearer eyJBdXRoZW50aWNhdGlvblR5cGUiOiJCZWFyZXIiLCJOYW1lQ2xhaW1UeXBlIjoiaHR0cDovL3NjaGVtYXMueG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qQhygiDp59HPJAxVJDZZ4SsTKqPC3D2Fqd_U3CmrT4ULSk0FbE7aZ61dHpYYpJPlRXxwT0Urgv1lZgqwtv0h7ApwqxGALB9UlZTujLF2ASFCmoNYe250TagbVZDfLh1rR5UWpC0usJoiPVfDynL-p-S6rnhLaPqrRiku2kI58zA0NME19da90bV3f2-WFTnr5cNNjs1UFj85xOiQd0xgMcyIoJr4yzJiMBiyr2gTSK4vdQVYPoBRfTQvxtDBbw7els3hlcKbU98gvBeQkQ2eEW18kTdgOyHg77I7UUZ5VFpNiz6R_ORBsUUbfSUW0mAWrg
Content-Length: 0
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/16.0.1)
{
"ErrorMessage": "Delete operation is not supported by WorkOrder entity.",
"ErrorCode": "ERROR_CODE_1000",
"TimeStamp": "2021-12-20T10:17:32.1004117Z"
}
WorkZone Example
Some entities like WorkZone require a special command for deletion, resulting in CUSTOM_COMMAND_ERROR error message if DELETE is attempted.
DELETE <<AM Host Name>>/api/v1/base/WorkZone/7 HTTP/1.1
Accept-Encoding: gzip,deflate
CompanyName: <<Sample Company>>
Content-Type: application/json
Authorization: Bearer eyJBdXRoZW50aWNhdGlvblR5cGUiOiJCZWFyZXIiLCJOYW1lQ2xhaW1UeXBlIjoiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZSIsIlJvbGVDbGFpbVR5cGUiOiJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIiwiQ2xhaW1zIjpbeyJUeXBlIjoiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZSIsIlZhbHVlIjoiY2VhcGljbGllbnQuMS4xODY4LmQxZWYiLCJWYWx1ZVR5cGUiOiJodHRwOi8vd3d3LnczLm9yZy8yMDA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4.5.2 (Java/16.0.1)
{
"ErrorMessage": "Use custom command for 'WorkZone' for that action.",
"ErrorCode": "CUSTOM_COMMAND_ERROR",
"TimeStamp": "2021-12-20T12:55:37.7493052Z"
}
Applying to other EntityTypes
The base DELETE operation covers the only those classes derived from RemovableCorrigoEntity class.