You can use the portal service to access and manage users in an organization. A user is a stored identity that represents a registered user of the portal.
Working with users
A user is created when someone signs up for a developer account, when an account is created for a user by an administrator, or when someone joins an organization. When an account is created, an identity and a role are assigned. The role defines the set of privileges and operations that the user can perform within the organization associated with the account.
Administrators can also use data management tools and ArcGIS REST API to create and manage users. Only an administrator or the owner of a user's account can make updates to users within an organization.
The typical way to work with users is to:
- Invite users or create new users in the portal.
- Search for users.
- Assign users to groups.
- Manage user properties.
Code examples
Search for a user
Use a query to search users by name, description, and other information.
APIs
const portal = new Portal();
portal.url = "https://www.arcgis.com/"
portal.authMode = "auto";
portal.load()
.then(()=> {
const queryParameters = {
query: "JSmith"
};
portal.queryUsers(queryParameters).then((response)=>{
console.log(response);
});
});
REST API
curl https://www.arcgis.com/sharing/rest/community/users \
-d 'q=JSmith' \
-d 'f=pjson' \
-d 'token=<ACCESS_TOKEN>'
{
"query": "JSmith",
"total": 189,
"start": 1,
"num": 10,
"nextStart": 11,
"results": [
{
"username": "OntarioAdmin",
"id": "08c59cc53ae5c2ad7532549808521e4f",
Get a user
Find a user with their username.
APIs
const url = "https://www.arcgis.com/sharing/rest/community/users/jsmith"
const options = {
query: {
f: "pjson"
},
responseType: "pjson"
};
esriRequest(url, options,{
}).then((response)=>{
const data = response.data
console.log(data);
})
REST API
curl https://www.arcgis.com/sharing/rest/community/users/jsmith \
-d 'f=pjson'
{
"username": "JSmith",
"id": "b46f4fffc4694c238862d69b39e1db33",
"fullName": "",
"firstName": "",
"lastName": "",
"created": 1556719488000,
"modified": 1571230751000,
"provider": "arcgis"
}
Update user information
Update user profile information such as their role or credits assigned.
APIs
from arcgis.gis import GIS
gis = GIS(username="USERNAME", password="PASSWORD")
user = gis.users.get(gis.users.me.username)
results = user.update(description="A new description of your user account.")
print(results)
REST API
curl https://www.arcgis.com/sharing/rest/community/users/<USERNAME>/update \
-d 'username=<USERNAME>'
-d 'description=A new description of user ' \
-d 'f=pjson' \
-d 'token=<ACCESS_TOKEN>'
{
"success": true
}
Get invitation status
Find the status of an invitation that was sent to a user to join the portal.
APIs
from arcgis.gis import GIS
gis = GIS(username="USERNAME", password="PASSWORD")
invitation = gis.users.invitations.get("INVITATION_ID")
print(invitation)
REST API
curl https://www.arcgis.com/sharing/rest/community/users/<USERNAME>/invitations/<INVITATION_ID> \
-d 'f=pjson' \
-d 'token=<ACCESS_TOKEN>'
{{
"id": "<INVITATION_ID>",
"targetType": "group",
"targetId": "GROUP_ID",
"received": "DATE_RECEIVED",
"accepted": false,
"mustApprove": false,
"email": null,
"role": "group-member",
"type": "user",
"dateAccepted": -1,
"expiration": 1614711430000,
"created": "DATE_RECEIVED",
"username": "USERNAME",
"fromUsername": {
"username": "",
"fullname": ""
},
"group": {
"id": "GROUP_ID",
"title": "title",
"isInvitationOnly": true,
"owner": "GROUP_OWNER",
"description": "GROUP_DESCRIPTION",
"snippet": null,
"tags": [
],
"typeKeywords": [
],
"phone": null,
"sortField": "title",
"sortOrder": "asc",
"isViewOnly": false,
"thumbnail": null,
"created": 1612987767000,
"modified": 1613758035000,
"access": "public",
"capabilities": [
],
"isFav": false,
"isReadOnly": false,
"protected": false,
"autoJoin": false,
"notificationsEnabled": false,
"provider": null,
"providerGroupName": null,
"leavingDisallowed": false,
"hiddenMembers": false,
"displaySettings": {
"itemTypes": ""
}
}}
Tutorials
Use tools to create different types of content and build content-driven applications.
Web maps
Create a web map
Use Map Viewer to create a web map for your application.
Style layers in a web map
Use Map Viewer to style layers in a web map.
Display a web map
Create and display a map from a web map.
Web scenes
Create a web scene
Use Scene Viewer to create a web scene for your application.
Style layers in a web scene
Use Scene Viewer to style layers in a web scene.
Display a web scene
Create and display a scene from a web scene.
Feature layers
Import data to create a feature layer
Use data management tools to import files and create a feature layer in a feature service.
Manage a feature layer
Use a hosted feature layer item to set the properties and settings of a feature layer in a feature service.
Add a feature layer
Access and display point, line, and polygon features from a feature service.
Vector tile layers
Create a vector tile service
Use data management tools to create a new vector tile service from a feature service.
Add a vector tile layer
Access and display a vector tile layer in a map.
Basemap layers
Create a custom basemap style
Use the Vector tile style editor to style a vector tile basemap layer.
Display a custom basemap style
Add and display a styled vector tile basemap layer.
Services
Portal service
Store, manage, and access private and public content.
API 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.
Developer dashboard
Manage API keys, service usage, and data with the ArcGIS Developers website.
ArcGIS.com
Create, manage, and share content and data with GIS tools.
ArcGIS Enterprise
Create, manage, analyze, and share data, maps, and applications in your organization.
Map Viewer
Create, explore, and share web maps for 2D applications.
Scene Viewer
Create, explore, and share web scenes for 3D applications.
Vector tile style editor
Style vector tile basemap layers for applications.
ArcGIS Pro
Explore, visualize, and analyze both 2D and 3D data with desktop GIS tools.