Share Items

Description

Shares a batch of items with the specified list of groups (POST only). 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.

Request Parameters

Parameter

Details

[Common Parameters]

For a complete listing, see Common parameters.

everyone

If true, the items will be shared with everyone, e.g., they will be publicly accessible.

org

If true, the items will be shared with everyone in the user's organization. If the user is not part of an organization, setting this to true will return an exception.

items

A comma-separated list of items to be shared.

groups

A comma-separated list of group IDs with which the items will be shared.

confirmItemControl

Set to true when the items will be shared with groups that have item update capability so that any member of such groups can update the items that are shared with them.

Response Properties

Property

Details

results

An array of JSON objects, one for each item requested. Each object consists of the itemId, a success flag to indicate if the item was successfully shared, and a notSharedWith array with a list of groups the item could not be shared with. If an error occurred in sharing an item, an error object is also returned.

Example Usage

URL for Share Items

http://www.arcgis.com/sharing/rest/content/users/jsmith/shareItems
everyone: false
items=93b54c8930ae46d9a00a7820cb3ebbd1,bb8e3d443ab44878ab8315b00b0612ca
groups=4774c1c2b79046f285b2e86e5a20319e,cc5f73ab367544d6b954d82cc9c6dab7

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": [
        
      ]
    }
  ]
}

3/3/2017