/updateItems: Update Items

URL:
https://[root]/content/updateItems
Methods:
GET

Example Usage

The following is a sample ArcGIS Enterprise POST request for the updateItems operation:

1
2
3
4
5
6
POST /sharing/rest/content/updateItems HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

items=[{"2678d3002eea4e4a825e3bdf10016e61": {"categories": ["/Categories/Geology", "/Categories/Elevation"]}},{"c3ad4ed8bcf04d619537cfe252a1760d": {"categories": ["/Categories/Geology", "/Categories/Land cover/Forest/Deciduous Forest"]}},{"9ced00fdce3e4b20bb4b05155acbe817":{"categories": []}}]

Description

The updateItems operation allows an item owner or organization administrator to update, in bulk, the item's content categories. A maximum of 100 items can be bulk updated per request.

Request Parameters

ParameterDetails

items

A JSON array of item objects, where each item is specified by its item ID.

When updating the item's content categories, the item object should contain a categories array that lists all content categories to update on the item, each with full hierarchical path prefixed with /. In ArcGIS Online, content category limits are set based on the limits set by the organization. For ArcGIS Enterprise organizations, each item can be categorized to a maximum of 20 categories.

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
[{
  "2678d3002eea4e4a825e3bdf10016e61": {
    "categories": ["/Categories/Geology", "/Categories/Elevation"]
  }
}, {
  "c3ad4ed8bcf04d619537cfe252a1760d": {
    "categories": ["/Categories/Geology", "/Categories/Land cover/Forest/Deciduous Forest"]
  }
}, {
  "9ced00fdce3e4b20bb4b05155acbe817": {
    "categories": []
  }
}]

f

The response format. The default format is html.

Values: html | json | pjson

Response Properties

PropertyDetails

results

An array of JSON objects, one for each item requested. Each object is made up of the itemId and a success flag to indicate whether the item was successfully updated. If an error occurs during updating an item, an error object is also returned.

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[
  {
    "itemId": "c3ad4ed8bcf04d619537cfe252a1760d",
    "success": false,
    "error": {
      "code": 400,
      "message": "Item does not exist or is inaccessible."
    }
  },
  {
    "itemId": "9ced00fdce3e4b20bb4b05155acbe817",
    "success": true
  },
  {
    "itemId": "2678d3002eea4e4a825e3bdf10016e61",
    "success": true
  }
]

JSON Response Syntax

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
  "results": [
    {
      "itemId": "<itemId1>",
      "success": true | false
    },
    {
      "itemId": "<itemId2>",
      "success": true | false,
      "error": {
        "code": <error code>,
        "message": "<error message>"
      }
    },
    {
      "itemId": "<itemId3>",
      "success": true | false
    }
  ]
}

JSON Response Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
  "results": [
    {
      "itemId": "9ced00fdce3e4b20bb4b05155acbe817",
      "success": true
    },
    {
      "itemId": "c3ad4ed8bcf04d619537cfe252a1760d",
      "success": false,
      "error": {
        "code": 400,
        "message": "Item exceeds max size of 20 categories."
      }
    },
    {
      "itemId": "2678d3002eea4e4a825e3bdf10016e61",
      "success": true
    }
  ]
}

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

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close