World Geocoding Service access

Geosearch versus geocode operations

The World Geocoding Service classifies the requests you submit into one of two categories: geosearch or geocode. Geosearching can be done free of charge, but geocoding consumes credits.

Geosearching and geocoding capabalities are similar—both find locations and return them to you—the main difference is in what you do with the results. If you present the location temporarily on a map, it is a geosearch, and the operation is free. If you store the locational data, in a database for example, the operation is classified as a geocode, and is required to consume credits. Some operations are strictly geocoding operations, such as geocoding many addresses in one request (batch geocoding), because it is assumed you will always store those results.

How to perform geocoding operations

If you are going to store the results of a geocoding request, you need to include the forStorage parameter and set it to true. (The default value is false, so you don't need to specify it when performing a geosearch.) Whenever forStorage is true, providing a valid token with the token parameter is also required. Accessing services provided by Esri describes how to generate a token. Generating a valid token requires an ArcGIS Online subscription.

Providing authentication credentials to ArcGIS Online

As a developer, you can provide authentication credentials in one of two ways—by prompting end users to enter their authenticated login or by storing credentials with the application.

Prompting end users to sign in

You can use the Identity Manager component in the client APIs to manage the login process. The Identity Manager simplifies the process of working with secure resources. It handles the process of prompting the user for their credentials, generating a token, and appending it to the request

If you are using the ArcGIS API for JavaScript to build your application, you can include the IdentityManager dijit in your application to handle authentication. The IdentityManager dijit allows users to sign into ArcGIS Online. Once the user has signed in, any subsequent REST requests made from within that client session using the esri.request object will automatically be part of that authenticated session. Using the IdentityManager also enables single sign on and identity flow for the case of fully hosted JavaScript web applications that are hosted within arcgis.com. Similar facilities are available in the other client SDKs.

Storing credentials with the application

You can hardcode the credentials in your application and use the REST API to obtain an access token in exchange for the application credentials. It is your responsibility to keep these application credentials secure. In most cases this implies keeping the credentials on the server and impementing a proxy service. For example, the ArcGIS API for JavaScript provides an example of how to implement such a proxy page.

Authetication using the REST API

To access the secured services Esri provides, you must pass a token as a parameter in your REST requests. Accessing services provided by Esri describes this process.

10/6/2017