/canRecycle: Can Recycle Item

URL:
https://<root>/content/users/[userName]/items/[itemID]/canRecycle
Methods:
GET
Version Introduced:
ArcGIS Online June 2024

Example Usage

URL for Can Recycle Item

Use dark colors for code blocksCopy
1
https://org.arcgis.com/sharing/rest/content/users/jsmith/items/b512083cd1b64e2da1d3f66dbb135956/canRecycle?f=json

Description

The canRecycle operation indicates whether an item is supported by the recycle bin or not.

If the returned response from canRecycle is true, this means that the item is supported by the recycle bin. A false response is returned if an item is either not supported by the recycle bin or the item cannot be recycled due to dependencies. The error response will show a list of offendingItems that are dependent on the item that the user is trying to recycle. canRecycle will return false until all dependent items on the offendingItems list are recycled or permanently deleted.

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.

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
{
  "itemId": "<item id>",
  "success": true | false
}

JSON Response example

Item is supported by the recycle bin:

Use dark colors for code blocksCopy
1
2
3
4
{
  "itemId": "e03f626be86946f997c29d6dfc7a9666",
  "success": true
}

Item is not supported by the recycle bin:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
{
  "itemId": "a34c2e6711494e62b3b8d7452d4d6235",
  "success": false,
  "error": {
    "code": 400,
    "messageCode": "CONT_0298",
    "message": "Unable to recycle item a34c2e6711494e62b3b8d7452d4d6235. Item is part of an unsupported relationship type or item type.",
    "offendingItems": [

    ]
  }
}

Item cannot be recycled due to dependencies:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "itemId": "a34c2e6711494e62b3b8d7452d4d6235",
  "error": {
    "code": 400,
    "messageCode": "CONT_00481",
    "message": "Unable to delete item. This service item has a related Service item",
    "offendingItems": [
        {
            "itemId": "e03f626be86946f997c29d6dfc7a9666",
            "title": "Countries_WFS",
            "type": "WFS"
        },
        {
            "itemId": "ea433f31f1bd4d6787cf6a82b0a8a7a5",
            "title": "WorldMap_OGC",
            "type": "OGCFeatureServer"
        }
    ]
  },
  "success": false
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.