Groups

A group is a collection of items available to a specific set of users in the portal.

Working with groups

Groups are used to organize and share items and define which users can access and view specified content. You can create groups of hosted layers, web maps, or any other item type. Or you can create a group and add users to it, allowing them to collaborate and share items within the group.

The typical workflow for using groups is to:

  1. Define a group in the portal.
  2. Add items the group.
  3. Add users to the group.
  4. Manage the group properties.

Examples

Search for a group

Find a one or more groups in the portal using a query.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for JavaScriptArcGIS API for PythonArcGIS Runtime API for iOS
Use dark colors for code blocksCopy
      
1
2
3
4
5
6
import { searchGroups } from "@esri/arcgis-rest-portal"
// Find groups with text
searchGroups("water", {portal: "https://www.arcgis.com/sharing/rest"})
  .then((response)=>{
    console.log(response);
  });

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
   
1
2
3
curl https://www.arcgis.com/sharing/rest/community/groups \
-d 'q=water' \
-d 'f=pjson'

Create a new group

Define a new group and how it can be accessed.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for Python
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
import { createGroup } from "@esri/arcgis-rest-portal"
import { ArcGISIdentityManager } from "@esri/arcgis-rest-request"

ArcGISIdentityManager.fromToken({
  token: "ACCESS_TOKEN", //Token representing an ArcGIS Identity from performing oAuth 2.0
})
  .then(authentication => {
    return createGroup({
      group: {
        title: "Traffic issues",
        access: "public",
      },
      authentication: authentication,
      portal: "https://www.arcgis.com/sharing/rest",
    });
  })
  .then(response => {
    console.log(response)
  });

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
     
1
2
3
4
5
curl https://www.arcgis.com/sharing/rest/community/createGroup \
-d 'title=Traffic issues' \
-d 'access=public' \
-d 'f=pjson' \
-d 'token=<ACCESS_TOKEN>'

Invite users to a group

Invite users by their user names.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for Python
Use dark colors for code blocksCopy
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { inviteGroupUsers } from "@esri/arcgis-rest-portal";
import { ArcGISIdentityManager } from "@esri/arcgis-rest-request";

ArcGISIdentityManager.fromToken({
  token: "ACCESS_TOKEN", //Token representing an ArcGIS Identity from performing oAuth 2.0
}).then((authentication) => {
  return inviteGroupUsers({
    id: "GROUP_ID",
    users: "USER_TO_INVITE",
    role: "group-member",
    expiration: "20160",
    authentication: authentication,
  });
}).then((response) => {
  console.log(response);
});

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
      
1
2
3
4
5
6
curl  https://www.arcgis.com/sharing/rest/community/groups/<GROUP_ID>/invite \
-d 'users=<USER_TO_INVITE>' \
-d 'role=group member' \
-d 'expiration=20160' \
-d 'f=pjson' \
-d 'token=<ACCESS_TOKEN>'

Add items to a group

Add an item to group to be shared with a set of users.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for Python
Use dark colors for code blocksCopy
                  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { shareItemWithGroup } from "@esri/arcgis-rest-portal"
import { ArcGISIdentityManager } from "@esri/arcgis-rest-request"

ArcGISIdentityManager.fromToken({
  token: "ACCESS_TOKEN", //Token representing an ArcGIS Identity from performing oAuth 2.0
})
  .then(authentication => {
    return shareItemWithGroup({
      id: "ITEM_ID",
      groupId: "GROUP_ID",
      owner: "ITEM_OWNER",
      authentication: authentication,
      portal: "https://www.arcgis.com/sharing/rest",
    });
  })
  .then(response => {
    console.log(response)
  });

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
    
1
2
3
4
curl  https://www.arcgis.com/sharing/rest/content/users/<USERNAME>/items/<ITEM_ID>/share \
-d 'f=json' \
-d 'groups=<GROUP_ID>' \
-d 'token=<ACCESS_TOKEN>'

Search for group content

Find items shared with a group using a query.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for JavaScriptArcGIS API for PythonArcGIS Runtime API for iOS
Use dark colors for code blocksCopy
         
1
2
3
4
5
6
7
8
9
import { searchGroupContent } from "@esri/arcgis-rest-portal";
// Find items that match in group
searchGroupContent({
  q: "bike",
  groupId: "d6340748701d4ccfb18ad3c42b7feb9e",
  portal: "https://www.arcgis.com/sharing/rest",
}).then((response) => {
  console.log(response);
});

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
   
1
2
3
curl  https://www.arcgis.com/sharing/rest/content/groups/d6340748701d4ccfb18ad3c42b7feb9e/search \
-d 'q=bike' \
-d 'f=pjson'

Update properties

Change the properties of a group such as the name, description, and permissions.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for Python
Use dark colors for code blocksCopy
              
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { updateGroup } from "@esri/arcgis-rest-portal";
import { ArcGISIdentityManager } from "@esri/arcgis-rest-request";

ArcGISIdentityManager.fromToken({
  token: "ACCESS_TOKEN", //Token representing an ArcGIS Identity from performing oAuth 2.0
}).then((authentication) => {
  return updateGroup({
    group: { id: "GROUP_ID", title: "new" },
    portal: "https://www.arcgis.com/sharing/rest",
    authentication: authentication,
  });
}).then((response) => {
    console.log(response);
});

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
    
1
2
3
4
curl  https://www.arcgis.com/sharing/rest/community/groups/GROUP_ID/update \
-d 'title=new' \
-d 'f=pjson' \
-d 'token=<ACCESS_TOKEN>'

Tutorials

Use tools to create different types of content and build content-driven applications.

Web maps

Web scenes

Feature layers

Vector tile layers

Basemap layers

Services

Portal service

Store, manage, and access private and public content.

API support

Full supportPartial supportNo support
  • 1. Limited operations, use HTTP requests.
  • 2. Access via ArcGIS REST JS.

Tools

Use tools to access the portal and create and manage content for applications.

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