- URL:
- https://[root]/content/users/[userName]/items/[itemID]/canReassign
- Methods:
POST
Example usage
The following is a sample ArcGIS Online POST request for the can
operation:
POST /webadaptor/sharing/rest/content/users/itemowner/items/b512083cd1b64e2da1d3f66dbb135956/canReassign HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
item=b512083cd1b64e2da1d3f66dbb135956&targetUsername=newOwner&f=pjson
The following is a sample ArcGIS Enterprise POST request for the can
operation:
POST /webadaptor/sharing/rest/content/users/itemowner/items/b512083cd1b64e2da1d3f66dbb135956/canReassign HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
item=b512083cd1b64e2da1d3f66dbb135956&targetUsername=newOwner&f=pjson
Description
The can
operation checks whether an item owned by one user can be successfully reassigned to a specified user before performing the reassignItem operation. Users assigned the default administrator role, or a custom role with administrative privileges, can perform this operation. The item owner can also use this operation; if the item owner that performs this operation is not a default administrator, or assigned a custom role with administrative privileges, they must have the portal:
privilege assigned to them to transfer content to another user.
Some item relationships (for example, a view created from another view instead of a primary layer) may block item reassignment. The conflicting item is listed in the error response.
Request parameters
Parameter | Details |
---|---|
| For a complete listing, see Common parameters. |
| The username of the user the item will be reassigned to. For a user to be eligible to receive transferred content, they must meet the following requirements:
If the above requirements are not met, an error response will be returned. Example:
|
Response properties
Property | Details |
---|---|
| Indicates if the operation was successful. |
| The ID of the reassigned item. |
JSON Response syntax
The response syntax example below demonstrates an error response, returned when the user specified in the target
parameter does not have the proper permissions to be reassigned an item:
{
"itemId": "<item id>",
"success": true | false,
"error": {
"code": <error code>,
"messageCode": "<error message code>",
"message": "<error message>",
"details": [
{
"itemId": "<item id>",
"type": "<item type>",
"url": "<url>",
"reservedTypeKeywords": [
"<reserved type keyword1>",
"<reserved type keyword2>"
],
"owner": "<owner>"
}
]
}
}
The response syntax example below demonstrates a success response:
{
"itemId": "<item id>",
"success": true | false
}
JSON Response example
The response example below demonstrates an error response, returned when the user specified in the target
parameter does not have the proper permissions to be reassigned an item:
{
"itemId": "3fbb6f64dd3c41da8a5f9dd4be11a9fe",
"success": false,
"error": {
"code": 400,
"messageCode": "CONT_004821",
"message": "Unable to reassign item. This service item 'bb8e3d443ab44878ab8315b00b0612ca' has Views, that is related to other services",
"details": [
{
"itemId": "07efda2ec8934d0cab3b68018758701a",
"type": "Feature Service",
"url": "https://machine.domain.com/webadaptor/rest/services/FS123_View/FeatureServer",
"reservedTypeKeywords": [
"Hosted Service",
"View Service"
],
"owner": "FSowner"
}
]
}
}
The response example below demonstrates a success response:
{
"itemId": "<item id>",
"success": true | false
}