Property ApiKey
ApiKey
Gets or sets the API key that allows your app to access ArcGIS location services and private portal items.
Declaration
public string ApiKey { get; set; }
Property Value
Type | Description |
---|---|
System. |
The API key that allows your app to access ArcGIS location services and private portal items. |
Implements
Remarks
An API key is a unique long-lived access token that is used to authenticate and monitor requests to ArcGIS
location services and private portal items. You can create and manage an API key using your portal when you
sign in with an ArcGIS Location Platform account or an ArcGIS Online account with administrator access or a
custom role that has the Generate API keys
privilege. 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.
Setting the API key on a specific resource overrides the default key set on Api
In addition to setting an Api
Classes that expose an API key property by implementing IApi
- Arc
GISScene Layer - Arc
GISTiled Layer - Arc
GISVector Tiled Layer - Basemap
- Esri.
Arc GISRuntime. Mapping. Basemap Styles Service - Closest
Facility Task - Export
Tile Cache Task - Export
Vector Tiles Task - Geodatabase
Sync Task - Locator
Task - Route
Task - Service
Area Task - Service
Feature Table
Note: An API key created with a referrer is not supported. If you need service requests to include the
referrer, call Use
var myReferer = new Uri("http://foo.bar");
ArcGISRuntimeEnvironment.Initialize(
config => config.UseApiKey("AAPK...")
.ConfigureHttp(
httpConfig => httpConfig.UseDefaultReferer(myReferer)));
For more information, see API key authentication and Types of authentication.
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.10 - 200.6 |
.NET | 100.13 - 200.6 |
.NET Windows | 100.13 - 200.6 |
.NET Android | 200.0 - 200.6 |
.NET iOS | 200.0 - 200.6 |
.NET Framework | 100.10 - 200.6 |
Xamarin.Android | 100.10 - 100.15 |
Xamarin.iOS | 100.10 - 100.15 |
UWP | 100.10 - 200.6 |