/shareItems: Share Items

URL:
https://[root]/content/users/[userName]/shareItems
Methods:
POST

Example Usage

URL for Share Items

Use dark colors for code blocksCopy
1
2
3
4
https://www.arcgis.com/sharing/rest/content/users/jsmith/shareItems
everyone: false
items=93b54c8930ae46d9a00a7820cb3ebbd1,bb8e3d443ab44878ab8315b00b0612ca
groups=4774c1c2b79046f285b2e86e5a20319e,cc5f73ab367544d6b954d82cc9c6dab7

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

ParameterDetails

[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

PropertyDetails

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.

JSON Response Syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "results": [
    {
      "itemId": "3fbb6f64dd3c41da8a5f9dd4be11a9fe",
      "success": false,
      "notSharedWith": [

      ],
      "error": {
        "code": 500,
        "message": "Item does not exist or is inaccessible"
      }
    },
    {
      "itemId": "07efda2ec8934d0cab3b68018758701a",
      "success": true,
      "notSharedWith": [

      ]
    }
  ]
}

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