Update Item

Description

The Update Item operation (POST only) allows users to update item information and their file, URL, or text depending on type. Users can use this operation to update item information such as title, description, tags, and so on, or use it to update an item's file, URL, or text. This call is available to the user and the administrator of the organization.

The parameters that are to be updated need to be specified in the request. Parameters not specified will not be affected.

All parameters for this operation are optional.

Upload of files can be done asynchronously or in multiple parts. See Add Item for more information.

Request Parameters

Parameter

Details

[Common Parameters]

For a complete listing, see Common parameters.

[Update Item Parameters]

For a complete listing of all item parameters available to update, see Item parameters.

clearEmptyFields

Clears any fields that are passed in empty (for example, snippet=&description=).

file

The file to be updated.

url

The URL of the item to be updated.

dataUrl

The URL where the item can be downloaded. The resource will be downloaded and stored as a file type. Similar to uploading a file to be added, but instead of transferring the contents of the file, the URL of the data file is referenced and creates a file item.

Please see the implementation details section below which discusses this parameter in further details.

text

The text content for the item to be updated.

async

If true, the file is uploaded asynchronously. If false, the file is uploaded synchronously. This only applies to item types that require files.

multipart

If true, the file is uploaded in multiple parts. See the description above for more information.

serviceProxyParams

A JSON object that provides rate limiting and referrer checks when accessing secured services.

Example: serviceProxyParams:{"hitsPerInterval":2,"intervalSeconds":60,"referrers":["http://<servername>"]}

createAsServiceProxy

If true, a service URL item is updated as a proxy item without embedding credentials. It can be used to take advantage of the portal sharing model for security reasons, hide actual service URLs, rate limiting and referrer checks, etc.

Example: createAsServiceProxy=true

filename

(Required if multipart=true)

The filename being uploaded in multipart mode.

Implementation details for using the dataUrl parameter

  • The referenced dataUrl, has to be an unsecured URL where data can be downloaded.
  • This operation is asynchronous, therefore the client should check the item's status before using. If the status is "completed", the resource is downloaded and the file item is added successfully.
  • If the resource supports Byte Ranges and the content length is larger than 500kb, Range GET's are used to download the file in parts.
  • Multiple parallel threads download the file parts and perform a file-based merge on them. This is not performed in-memory as to avoid buffering. If a part can't be downloaded, it attempts once more before failing. All parts needs to be downloaded successfully before the item can be created.
  • If overwrite=true an existing file is updated.

Service Proxy Parameters

ArcGIS Online and Portal for ArcGIS users can register premium services, as well as services published on their own server, as secured service proxies. If working with secured services, you have the option to save the username and password credentials directly with the item. Setting the serviceProxyParams provides additional control over how these services are accessed by supplying rate limiting and referrer checks. In other words, by setting these parameters, you provide more control over who can access these services and how much they can use them.

The serviceProxyParams JSON object used to set rate limiting and referrer checks on secured services is described below.

Parameter

Details

hitsPerInterval

Number of requests that will be allowed within a specifed time interval of intervalInSeconds. Default value is "2".

intervalSeconds

Integer value indicating the interval time in seconds. Default value is "60".

referrers

Array of referrers allowed to access service.

If rate limit is exceeded, an error will occur.

{
"error": {
   "code": 429,
   "messageCode": "CONT_0049",
   "message": "Rate limit exceeded. Please try again later.",
   "details": []}
}"

NoteNote:

Both hitPerInterval and IntervalSeconds need to be greater than zero (0) in order for rate limiting to work.

A sample serviceProxyParams JSON object is as follows:

{
   "hitsPerInterval":2,
   "intervalSeconds":60,
   "referrers":["https://server1","https://server2"],"https://*arcgis.com] 
   //*.arcgis.com allows any subdomain from arcgis.com to be added

Response Properties

Property

Details

success

Indicates if the operation was successful.

id

The ID of the updated item.

Example Usage

URL for Update Item

http://www.arcgis.com/sharing/rest/content/users/jsmith/items/b512083cd1b64e2da1d3f66dbb135956/update
tags=regional map, trails

JSON Response Syntax

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

JSON Response Example

{
  "success": true,
  "id": "b512083cd1b64e2da1d3f66dbb135956"
}

10/6/2017