/unshareItems: Unshare Items

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

Example Usage

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /sharing/rest/content/users/jsmith/unshareItems HTTP/1.1
Host: org.arcgis.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

items=93b54c8930ae46d9a00a7820cb3ebbd1,bb8e3d443ab44878ab8315b00b0612ca&groups=4774c1c2b79046f285b2e86e5a20319e,cc5f73ab367544d6b954d82cc9c6dab7&f=pjson

The following is a sample ArcGIS Enterprise POST request for the unshareItems operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /<context>/sharing/rest/content/users/jsmith/unshareItems HTTP/1.1
Host: organization.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

items=93b54c8930ae46d9a00a7820cb3ebbd1,bb8e3d443ab44878ab8315b00b0612ca&groups=4774c1c2b79046f285b2e86e5a20319e,cc5f73ab367544d6b954d82cc9c6dab7&f=pjson

Description

The unshareItems operation unshares a batch of items with the specified list of groups.

Users assigned either the default administrator role, or a custom role with administrative privileges, may unshare items on behalf of the owner.

Request Parameters

ParameterDetails

items

A comma-separated list of items to be unshared.

groups

A comma-separated list of group IDs that should not share the items.

f

The response format. The default format is html.

Values: html | json | pjson

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 unshared, and a notUnsharedFrom array with a list of groups from which the item could not be unshared. If an error occurred in unsharing 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
{
  "results": [
    {
      "itemId": "<item id>",
      "success": true | false,
      "notUnsharedFrom": [<groups not able to share with>],
      "error": {
        "code": code,
        "message": "<error message>"
      }
    }
  ]
}

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
{
  "results": [
    {
      "itemId": "93b54c8930ae46d9a00a7820cb3ebbd1",
      "success": true,
      "notUnsharedFrom": [],
    },
    {
      "itemId": "bb8e3d443ab44878ab8315b00b0612ca",
      "success": false,
      "notUnsharedFrom": [],
      "error": {
        "code": 500,
        "message": "Item does not exist or is inaccessible"
      }
    }
  ]
}

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