Skip To Content

roles: Roles

  • URL:https://[root]/portals/[portalID]/roles
  • Child Resources:Role

Example usage

Below is a sample ArcGIS Online request URL used to access the roles resource:

https://org.arcgis.com/sharing/rest/portals/0123456789ABCDEF/roles?returnPrivileges=true&f=pjson

Below is a sample ArcGIS Enterprise request URL used to access the roles resource:

https://machine.domain.com/webadaptor/sharing/rest/portals/0123456789ABCDEF/roles?returnPrivileges=true&f=pjson

Description

This resource lists custom roles of an organization.

Request parameters

ParameterDetails
start

The number of the first entry in the result set response. The index number is 1-based. The default value of start is 1.

Example

start=11
num

The maximum number of results to be included in the result set response. The default value is 10, and the maximum allowed value is 100. Note that the actual number of returned results may be less than num. This happens when the number of results remaining after start is less than num.

Example

//Returns a max of 50 results in the response
num=50
returnPrivileges

If true, each role object in the response will have a privileges property listing all the privileges it has.

Values: true | false

f

The response format. The default format is html.

Values: html | json | pjson

Response properties

PropertyDetails
total

The total number of results found for the whole query.

Example

"total": 29,
start

The number of the first entry in the result set for this response. The index number is 1-based.

Example

"start": 1,
num

The number of results included in the result set for this response.

Example

"num": 3,
nextStart

The next entry index if the current result set doesn't contain all results, or -1 if it is the last batch.

Example

"nextStart": 4,
roles

A JSON array of role objects. See the response properties of role for details.

If returnPrivileges is true, a role object example:


{
  "id": "0U0NudFddh5rtfsc",
  "name": "roleName",
  "description": "This is a custom role",
  "created": 1446057576000,
  "modified": 1446057576000,
  "privileges": [
    "features:user:edit",
    "portal:publisher:publishFeatures",
    "portal:publisher:publishTiles",
    "portal:user:createGroup",
    "portal:user:createItem",
    "portal:user:joinGroup",
    "portal:user:joinNonOrgGroup",
    "portal:user:shareGroupToOrg",
    "portal:user:shareGroupToPublic",
    "portal:user:shareToGroup",
    "portal:user:shareToOrg",
    "portal:user:shareToPublic",
    "portal:user:viewOrgGroups",
    "portal:user:viewOrgItems",
    "portal:user:viewOrgUsers"
  ]
}

JSON Response syntax


{
  "total": <total number of roles for the organization>,
  "start": <the first record index in the response>,
  "num": <the number of roles included in the response>,
  "nextStart": <the next entry index>,
  "roles": [
    {
      <role1>
    },
    {
      <role2>
    },
    {
      <role3>
    }
  ]
}

JSON Response example


{
  "total": 6,
  "start": 1,
  "num": 10,
  "nextStart": -1,
  "roles": [
    {
      "id": "iAAAAAAAAAAAAAAA",
      "name": "Viewer",
      "description": "Viewer",
      "created": 1615440392550,
      "modified": 1615440392550,
      "privileges": [
        "portal:user:joinGroup",
        "portal:user:viewOrgGroups",
        "portal:user:viewOrgItems",
        "portal:user:viewOrgUsers",
        "premium:user:demographics",
        "premium:user:elevation",
        "premium:user:geocode",
        "premium:user:networkanalysis"
      ]
    },
    {
      "id": "iBBBBBBBBBBBBBBB",
      "name": "Data Editor",
      "description": "Data Editor",
      "created": 1615440392550,
      "modified": 1615440392550,
      "privileges": [
        "features:user:edit",
        "portal:user:joinGroup",
        "portal:user:viewOrgGroups",
        "portal:user:viewOrgItems",
        "portal:user:viewOrgUsers",
        "premium:user:demographics",
        "premium:user:elevation",
        "premium:user:geocode",
        "premium:user:networkanalysis"
      ]
    },
    {
      "id": "FnjKvnmkg7dfFYJL",
      "name": "Notebook_Adv",
      "description": "For Advanced Notebook users",
      "created": 1615441320983,
      "modified": 1615441321237,
      "privileges": [
        "features:user:edit",
        "portal:publisher:publishFeatures",
        "portal:user:createItem",
        "portal:user:joinGroup",
        "portal:user:shareToGroup",
        "portal:user:shareToOrg",
        "portal:user:viewOrgGroups",
        "portal:user:viewOrgItems",
        "portal:user:viewOrgUsers",
        "premium:publisher:createAdvancedNotebooks",
        "premium:publisher:createNotebooks",
        "premium:publisher:geoanalytics",
        "premium:publisher:rasteranalysis",
        "premium:publisher:scheduleNotebooks",
        "premium:user:elevation",
        "premium:user:geocode",
        "premium:user:geoenrichment",
        "premium:user:networkanalysis",
        "premium:user:spatialanalysis"
      ]
    },
    {
      "id": "QjZbbGVvJQi5BLVy",
      "name": "Notebook_Std",
      "description": "For Advanced Notebook users",
      "created": 1615441321390,
      "modified": 1615441321423,
      "privileges": [
        "features:user:edit",
        "portal:publisher:publishFeatures",
        "portal:user:createItem",
        "portal:user:joinGroup",
        "portal:user:shareToGroup",
        "portal:user:shareToOrg",
        "portal:user:viewOrgGroups",
        "portal:user:viewOrgItems",
        "portal:user:viewOrgUsers",
        "premium:publisher:createNotebooks",
        "premium:publisher:geoanalytics",
        "premium:publisher:rasteranalysis",
        "premium:publisher:scheduleNotebooks",
        "premium:user:elevation",
        "premium:user:geocode",
        "premium:user:geoenrichment",
        "premium:user:networkanalysis",
        "premium:user:spatialanalysis"
      ]
    },
    {
      "id": "H4PyrOyVjkDM9Ylu",
      "name": "WebAppsPub",
      "description": "For Web Apps Publisher users",
      "created": 1615441321448,
      "modified": 1615441321482,
      "privileges": [
        "features:user:edit",
        "portal:publisher:bulkPublishFromDataStores",
        "portal:publisher:publishFeatures",
        "portal:publisher:publishScenes",
        "portal:publisher:publishServerGPServices",
        "portal:publisher:publishServerServices",
        "portal:publisher:publishTiles",
        "portal:publisher:registerDataStores",
        "portal:user:createGroup",
        "portal:user:createItem",
        "portal:user:joinGroup",
        "portal:user:shareGroupToOrg",
        "portal:user:shareGroupToPublic",
        "portal:user:shareToGroup",
        "portal:user:shareToOrg",
        "portal:user:shareToPublic",
        "portal:user:viewOrgGroups",
        "portal:user:viewOrgItems",
        "portal:user:viewOrgUsers",
        "premium:publisher:geoanalytics",
        "premium:publisher:rasteranalysis",
        "premium:user:elevation",
        "premium:user:geocode",
        "premium:user:geoenrichment",
        "premium:user:networkanalysis",
        "premium:user:spatialanalysis"
      ]
    },
    {
      "id": "UtH97RjLjPG7s31W",
      "name": "TrackView_Viewer",
      "description": "For TrackView Viewers",
      "created": 1615441321505,
      "modified": 1615441321553,
      "privileges": [
        "portal:user:joinGroup",
        "portal:user:viewOrgGroups",
        "portal:user:viewOrgItems",
        "portal:user:viewOrgUsers",
        "portal:user:viewTracks",
        "premium:user:elevation",
        "premium:user:geocode",
        "premium:user:networkanalysis"
      ]
    }
  ]
}