- URL:
- https://[root]/content/users/[userName]/shareItems
- Methods:
- POST
Example Usage
The following is a sample ArcGIS Online POST request for the share operation:
POST /sharing/rest/content/users/jsmith/shareItems HTTP/1.1
Host: org.arcgis.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
items=93b54c8930ae46d9a00a7820cb3ebbd1,bb8e3d443ab44878ab8315b00b0612ca&groups=4774c1c2b79046f285b2e86e5a20319e,cc5f73ab367544d6b954d82cc9c6dab7&everyone=false&org=false&confirmItemControl=false&f=pjsonThe following is a sample ArcGIS Enterprise POST request for the share operation:
POST /<context>/sharing/rest/content/users/jsmith/shareItems HTTP/1.1
Host: organization.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
items=93b54c8930ae46d9a00a7820cb3ebbd1,bb8e3d443ab44878ab8315b00b0612ca&groups=4774c1c2b79046f285b2e86e5a20319e,cc5f73ab367544d6b954d82cc9c6dab7&everyone=false&org=false&confirmItemControl=false&f=pjsonDescription
The share operation shares a batch of items with the specified list of groups. Users can only share items with groups to which they belong. This operation also allows a user to share items with everyone, in which case the items are publicly accessible, or with everyone in their organization.
Users assigned either the default administrator role, or a custom role with administrative privileges, may unshare items on behalf of the owner. If an item has a public or org sharing level, there are no sharing restrictions. Items with a private sharing level may only be shared with groups to which the item owner has sharing access.
Request Parameters
| Parameter | Details | 
|---|---|
| 
 | If  Values:  | 
| 
 | If  Values:  | 
| 
 | A comma-separated list of items to be shared. | 
| 
 | A comma-separated list of group IDs with which the items will be shared. | 
| 
 | Set to  Values:  | 
| 
 | The response format. The default format is  Values:  | 
Response Properties
| Property | Details | 
|---|---|
| 
 | An array of JSON objects, one for each item requested. Each object consists of the  | 
JSON Response Syntax
{
  "results": [
    {
      "itemId": "<item ID1>",
      "success": true | false,
      "notSharedWith": [
        <groups not able to share the item with>
      ],
      "error": {
        "code": <error code>,
        "message": "<error message>"
      }
    },
    {
      "itemId": "<item ID2>",
      "success": true | false,
      "notSharedWith": [
        <groups not able to share the item with>
      ]
    }
  ]
}JSON Response Example
{
  "results": [
    {
      "itemId": "3fbb6f64dd3c41da8a5f9dd4be11a9fe",
      "success": false,
      "notSharedWith": [
      ],
      "error": {
        "code": 500,
        "message": "Item does not exist or is inaccessible"
      }
    },
    {
      "itemId": "07efda2ec8934d0cab3b68018758701a",
      "success": true,
      "notSharedWith": [
      ]
    }
  ]
}