Show / Hide Table of Contents

Method UseApiKey

UseApiKey(IArcGISConfiguration, String)

Adds a default API key that allows your app to access ArcGIS location services and private portal items.

Declaration
public static IArcGISConfiguration UseApiKey(this IArcGISConfiguration configuration, string apiKey)
Parameters
Type Name Description
IArcGISConfiguration configuration

ArcGIS Configuration

System.String apiKey

A string containing the API key.

Returns
Type Description
IArcGISConfiguration

A reference to this instance after the operation has completed.

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.

If the user is authenticated with the ArcGIS.com Portal, an API key is not needed to access ArcGIS Online location services. See CreateAsync(Uri, Boolean).

See Also
ApiKey

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0200.0 - 200.8
.NET200.0 - 200.8
.NET Windows200.0 - 200.8
.NET Android200.0 - 200.8
.NET iOS200.0 - 200.8
.NET Framework200.0 - 200.8
UWP200.0 - 200.8
In This Article
Back to top Copyright © 2022 Esri.