ArcGIS REST API

Can Delete Item

  • URL:http://<useritem-url>/canDelete(POST only)
  • Version Introduced:10.6.1

Description

Can Delete Item indicates whether an item can be deleted or not. When the returned response from Can Delete Item is true, the item can be deleted. When the returned response is false, the item cannot be deleted due to a variety of reasons. For example, delete protection has been set on the item or it has dependent capabilities.

Request Parameters

ParameterDetails
[Common Parameters]

For a complete listing, see Common parameters.

Response Properties

PropertyDetails
itemID

The ID of the queried item.

success

Indicates if the operation was successful.

Example Usage

URL for Delete Item

http://
<useritem-url>/sharing/rest/content/users/jsmith/items/b512083cd1b64e2da1d3f66dbb135956/canDelete

JSON Response Syntax

{
  "itemId": "<item id>",
  "success": true | false
}

JSON Response Example - item can be deleted

{
  "itemId": "e03f626be86946f997c29d6dfc7a9666",
  "success": true
}

JSON Response Example - item cannot be deleted as delete protection has been enabled

{
  "itemId": "a34c2e6711494e62b3b8d7452d4d6235",
  "success": false,
  "error": {
    "code": 400,
    "messageCode": "CONT_0048",
    "message": "Unable to delete item. Delete protection is turned on.",
    "offendingItems": [
      
    ]
  }
}

JSON Response Example - item cannot be deleted as it has dependent capabilities

{
  "itemId": "e03f626be86946f997c29d6dfc7a9666",
  "success": false,
  "error": {
    "code": 400,
    "messageCode": "CONT_00481",
    "message": "Unable to delete item. This service item has a related Service item",
    "offendingItems": [
      {
        "itemId": "9fcec52e8c924bd49d56a8f07e4214d5",
        "title": "map_wfs",
        "type": "WFS"
      }
    ]
  }
}