Using ArcGIS Earth Automation API

Configuration

You can configure ArcGIS Earth Automation API using the settings.json configuration file. The settings.json configuration file is typically located in the C:\Program Files\ArcGIS\Earth\bin\automation folder and is copied automatically to the user's Documents/ArcGISEarth/automation folder when ArcGIS Earth starts. In this way, users can configure ArcGIS Earth Automation API using the settings.json configuration file.

The autoStart function automatically enables ArcGIS Earth Automation API when ArcGIS Earth starts. The default is false. When autoStart=true, ArcGIS Earth creates a .NET Generic Host and starts a web service with an HTTP server implementation on your local machine at startup. Check the ArcGIS Earth Automation API status from the Advanced application settings.

Note:

  • ArcGIS Earth Automation API uses the settings.json configuration file in your directory first.

Configurable Automation API parameters

ArcGIS Earth Automation API works out of the box without special configuration. However, if you need to change the defaults, an understanding of the various configuration parameters is required.

ParameterDescription
autoStart

Enables ArcGIS Earth Automation API when ArcGIS Earth starts. The default is false.

baseUrl

Sets the URL that ArcGIS Earth Automation API will listen to. The default is http://localhost:8000.

Tip:
  • Only the HTTP protocol type is supported.
  • The default host of baseUrl is localhost. You can also use the local IP address or host name if you want ArcGIS Earth Automation API to be able to be accessed from a different origin.
  • ArcGIS Earth Automation API allows Cross-Origin Resource Sharing (CORS) requests from all origins with an HTTP scheme and allows any HTTP method. The settings of allowed origins and allowed HTTP methods are not supported yet. For more information, see the CORS policy options in ASP.NET Core.

webRoot

Specifies the web root directory used by ArcGIS Earth Automation API. This is optional. The default web root directory is in your Documents/ArcGISEarth/automation folder.

Tip:
  • Web root determines the relative path to the app's static assets. If the path doesn't exist, a no-op file provider is used. For more information, see WebRoot.

Connecting to ArcGIS Earth

Once the ArcGIS Earth Automation API is started, the client app can start communication with ArcGIS Earth via the RESTful Automation API.

To work with ArcGIS Earth Automation API, you need to understand how to construct a URL and interpret the response. All operations exposed by ArcGIS Earth Automation API are accessible through a hierarchy of endpoints.

When using the Automation API, you need a specific endpoint address for sending requests. The default endpoint is http://localhost:8000/arcgisearth/<controller>. For example, to get the camera information of ArcGIS Earth, the URL is as follows:

http://localhost/arcgisearth/camera

Check the ArcGIS Earth Automation API status from the Advanced application settings and use the sample page in your browser, or visit ArcGIS Earth Automation API GitHub for more details.