/copy: Copy Item

URL:
https://[root]/content/users/[userName]/items/[itemID]/copy
Methods:
POST
Version Introduced:
September 2020 | ArcGIS Enterprise 10.9

Example usage

The following is a sample ArcGIS Online request for the copy operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
https://www.arcgis.com/sharing/rest/content/users/jsmith/items/b512083cd1b64e2da1d3f66dbb135956/copy
title=MyNewItem Title
tags=MyTag1,MyTag2
folder=ea433f31f1bd4d6787cf6a82b0a8a7a5
includeResources=true
copyPrivateResources=true

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /webadaptor/sharing/rest/content/users/jsmith/items//b512083cd1b64e2da1d3f66dbb135956/copy HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

title=MyNewItem Title&folder=ea433f31f1bd4d6787cf6a82b0a8a7a5&tags=MyTag1,MyTag2&includeResources=false&copyPrivateResources=false&=pjson

Description

The copy operation creates a new item that is a copy of the original item on the server side. The newly created item will have a system generated itemID. The sharing access of the original item is not preserved for the copied item, which will have its sharing access set to private. As well, the relationships and dependencies of the original item are not maintained in the new item.

This operation is allowed in any of the following scenarios:

  • The original item being copied is owned by the user invoking the copy operation.
  • The user is an administrator.
  • The user has itemControl update capability.

Request parameters

ParameterDetails

title

The title of the destination item. If not specified, title of the original item is used.

tags

New set of tags (comma separated) of the destination item.

folder

Folder Id of the destination item. If the folder Id is not specified, then the item remains in the same folder.

If the administrator invokes a copy of an item belonging to another user, and does not specify the folder Id, the item gets created in the root folder of the administrator.

includeResources

If true, the file resources of the original item will be copied over to the new item. Private file resources will not be copied over. If false, the file resources of the original item will not be copied over to the new item. The default is false.

Values: true | false

copyPrivateResources

If true, and if includeResources is set to true as well, then the private resources of the original item will be copied over to the new item. If false, the private file resources of the original item will not be copied over to the new item. The default is false.

Values: true | false

f

The response format. The default format is html.

Values: html | json | pjson

Response properties

PropertyDetails

success

Indicates if the operation was successful.

itemId

The Id of the created item.

JSON Response syntax

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

JSON Response examples

Use dark colors for code blocksCopy
1
2
3
4
{
  "success": true,
  "id": "ea433f31f1bd4d6787cf6a82b0a8a7a5"
}
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{
  "error": {
    "code": 400,
    "message": "Unable to copy item.",
    "details": ["Folder 'fc2fa1433c314d489a6909a9990531d5' does not exist."]
  }
}

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