/share: Share Item (as item owner)

URL:
https://[root]/content/users/[userName]/items/[itemID]/share
Methods:
POST

Example usage

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
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:

Use dark colors for code blocksCopy
1
2
3
4
5
6
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

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

ParameterDetails

[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

Use dark colors for code blocksCopy
1
groups=4774c1c2b79046f285b2e86e5a20319e,cc5f73ab367544d6b954d82cc9c6dab7

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

PropertyDetails

notSharedWith

Array of groups with which the item could not be shared.

itemId

ID of the item being shared.

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
{
  "notSharedWith": [<groups not able to share with>],
  "itemId": "<item id>"
}

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
{
  "notSharedWith": ["cc5f73ab367544d6b954d82cc9c6dab7"],
  "itemId": "b512083cd1b64e2da1d3f66dbb135956"
}

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