Skip to content

How to work with the portal service

The general steps to run operations with the portal service.

1. Get the portal url

Before accessing and running operations in a portal, you need to determine the purpose of the work and evaluate whether ArcGIS Online or ArcGIS Enterprise is more suitable based on connectivity, security, scalability, and integration needs. To access a portal, you need an ArcGIS account which is associated with an organization that allows you to store and manage your content.

The base URL for a portal:

Use dark colors for code blocksCopy
1
https://www.arcgis.com/sharing/rest

To get the portal url:

  1. In a web browser, log into your portal with your ArcGIS account.
  2. Identify the portal URL from in the navigation bar.

2. Set up authentication

To access the portal, you need to set up authentication. The authentication method depends on the type of application you are building and the type of portal you are using. The following are the most common methods:

  • API key: API key authentication is a simple method that uses long-lived access tokens to securely access ArcGIS services, items, and perform operations.
  • User authentication: Uses OAuth 2.0 to allow users to sign in with their accounts, generating access tokens that grant applications the same privileges as the user's account to access secure resources and services.

Below are tutorials to set up authentication to use the portal service:

Create an API key

Create and configure API key credentials to get a long-lived API key access token.


Create OAuth credentials for user authentication

Create and configure OAuth credentials to set up user authentication.


3. Make a request

Once authentication is set up, follow these general steps to run an operation:

  1. Make a request to the ArcGIS REST operation endpoint that includes the access token in the request headers for authentication.
  2. Specify the operation parameters within the request payload, defining tasks like spatial analysis or querying specific data services.
  3. Submit the request to the ArcGIS REST API endpoint using the token's authentication to access and run the operation.
  4. Receive the response containing the results or confirmation of the executed operation.

Search for an item example

This example shows how to use a query to search for items in the portal. If many results are returned, use paging.

The public example searches for all items that contain the string, type, and owner. The private example searches for your private items that are web maps.

APIs

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for .NETArcGIS Maps SDK for SwiftArcGIS Maps SDK for KotlinArcGIS API for PythonArcGIS REST JS
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
23
24
25
26
const portal = new Portal({
  url: "https://www.arcgis.com/"
});
portal.load().then(()=>{
  const query = {
    query: "title: Seven Natural Wonders, type: web map, owner: esri_devlabs"
  };
  portal.queryItems(query).then((response)=>{
    console.log(response);
  });
});

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
## Public

curl https://www.arcgis.com/sharing/rest/search \
-d 'q=title:"Seven Natural Wonders of the World" AND type:"web map" AND owner:"esri_devlabs"' \
-d 'f=pjson'

## Private

curl https://www.arcgis.com/sharing/rest/search \
-d 'q=title:"Seven Natural Wonders of the World" AND type:"web map" AND owner:"<YOUR_USER_ID>"' \
-d 'f=pjson'
-d 'token=<ACCESS_TOKEN>'

API support

SearchItemsUsersGroupsSettingsSecurity
ArcGIS Maps SDK for JavaScript1111
ArcGIS Maps SDK for .NET1111
ArcGIS Maps SDK for Kotlin1111
ArcGIS Maps SDK for Swift1111
ArcGIS Maps SDK for Flutter1111
ArcGIS Maps SDK for Java1111
ArcGIS Maps SDK for Qt1111
ArcGIS API for Python
ArcGIS REST JS
Esri Leaflet222222
MapLibre GL JS222222
OpenLayers222222
CesiumJS222222
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.

Services

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