- URL:https://[root]/content/users/[userName]/items/[itemID]/share(POST only)
Example usage
The following is a sample ArcGIS Online POST request for the share operation:
POST /sharing/rest/content/users/jsmith/items/b512083cd1b64e2da1d3f66dbb135956/share HTTP/1.1
Host: org.arcgis.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
everyone=false&org=true&groups=4774c1c2b79046f285b2e86e5a20319e,cc5f73ab367544d6b954d82cc9c6dab7&f=pjson
The following is a sample ArcGIS Enterprise POST request for the share operation:
POST /webadaptor/sharing/rest/content/users/jsmith/items/b512083cd1b64e2da1d3f66dbb135956/share HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
everyone=false&org=true&groups=4774c1c2b79046f285b2e86e5a20319e,cc5f73ab367544d6b954d82cc9c6dab7&f=pjson
Description
The share operation shares an item with a set of specific groups that the user belongs to. This operation is available to the item owner and organization administrators, who may share an item to a group on the owner's behalf.
An item can have one of four sharing levels, represented in the access property of the item:
- private: the item is only accessible to the item owner
- public: the item is publically accessible to users outside of the owner's organization
- org: the item is accessible to all users within the same organization
- groups: the item is shared to one or more groups
Note:
If an item has multiple sharing levels, only the highest sharing level is shown in the access property. For example, if the item has the groups and public sharing levels, the access property will only show as public. If the shared item has the groups and org sharing levels, the access property will only show as org.
This operation does not have any restrictions if the shared item has the public or org sharing level. Items with a private sharing level can only be shared to groups the item owner has sharing access to.
Request parameters
Parameter | Details |
---|---|
[Common Parameters] | For a complete listing, see Common parameters. |
everyone | If true, this item will be shared with everyone, meaning that it will be publicly accessible and available to users outside of the organization. If set to false, the item will not be shared with the public. Values: true | false |
org | If true, this item will be shared with the organization. If set to false, the item will not be shared with the organization. Values: true | false |
groups | A comma-separated list of group IDs with which the item will be shared. To make an item private, keep this parameter empty in the request. Example
|
confirmItemControl | Set to true when the item will be shared with groups with item update capability so that any member of such groups can update the item that is shared with them. Values: true | false |
Response properties
Property | Details |
---|---|
notSharedWith | Array of groups with which the item could not be shared. |
itemId | ID of the item being shared. |
JSON Response syntax
{
"notSharedWith": [<groups not able to share with>],
"itemId": "<item id>"
}
JSON Response example
{
"notSharedWith": ["cc5f73ab367544d6b954d82cc9c6dab7"],
"itemId": "b512083cd1b64e2da1d3f66dbb135956"
}