Skip to content

Display a custom basemap style (2 of 3)

Use the portal to create an API key credential and access token to access your custom basemap style.

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 Create developer credentials window, click on the Expiration date field. Set the expiration date to one month from today's date.

  6. Set the Referrers field to include only the web domains you would like your access token to be used from.

  7. Click Next.

Select location services 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
  2. Click Next.

Grant item access

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

  1. In the Grant item access window, select the custom basemap item you just created.

  2. Click Add items.

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.