Skip to content

Use the portal to create an API key credential and access token to access basemaps and your feature layer.

API key credentials

The developer credentials creation interface in a portal

Prerequisites

Steps

Create an API key credential

You need to create an API key credential in your portal to generate an access token that you can use in requests to ArcGIS services. The privileges you set for the credential determine the capabilities of the token.

The expiration date and referrer URLs to restrict how long the access token can be used and the domain where it can be used.

  1. Sign in to your portal.

  2. In your portal, click Content > My content > New item.

  3. Click Content > My content > New item.

  4. Click Developer credentials > API key credentials and click Next.

  5. In the Where will you use these credentials? menu, select Public application.

  6. Click Next.

Grant item access

Grant item access so that the token can access private items in your portal.

  1. Select Grant access to specific items.

  2. Select the feature layer (hosted) item you just created.

  3. Click Add items.

Select privileges

Set the correct privileges so the access token can access services required in your app.

  1. In the Privileges window, check the following privilege(s).
    • Location services > Basemaps

Copy the access token

After configuring the properties of your API key credential, you can save it as a new item and generate an access token.

  1. In the Create developer credentials window, set the following properties:

    • Title: My API key credential
    • Folder: Developer credentials (Create a new folder)

    Click Next.

  2. In the Summary window, review the properties, privileges, and item access you have set. Then, click Next.

  3. To get your access token, select Generate the API key and go to item details page. I am ready to copy and save the key.

  4. Click Next.

  5. Copy the access token from the window that appears and store it in a safe location.

Now you have an API key credential and access token that allows your application to access ArcGIS services and content.

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