apiKey

The API key allows your app to access ArcGIS location services and private portal items. An API key is a long-lived access token that authorizes your application to access secure services, content, and functionality in ArcGIS. API keys are generated using API key credentials, a type of item you create and manage in your portal. API key credentials contain settings that allow you to generate API keys and manage properties such as their privileges and expiration date. To learn how to create and manage API keys, go to the Create an API Key tutorial. You must ensure that your API key has the correct privileges to access secure resources.

Note: An API key created with a referrer is not supported. If you need service requests to include the referrer, use the SDK's functionality to intercept the request and add an HTTP referer header.

In addition to setting an ArcGISEnvironment.apiKey at a global level for your application, you can set it on any class that implements ApiKeyResource. This overrides the ArcGISEnvironment.apiKey and enables more granular usage telemetry and management of the ArcGIS location resources used by your app.

Classes that expose an API key property by implementing ApiKeyResource include:

For more information, see API key authentication and Types of authentication.

Since

200.0.0