Configuring the REST API

ArcGIS Server REST API works out-of-the-box without requiring special configuration. However, if you needed to change the defaults, an understanding of the various configuration points is required.

Configuring the REST API

The REST configuration consists of one file, which is found in the <ArcGIS Server installation location>/Server/framework/runtime/tomcat/webapps/arcgis#rest/WEB-INF/classes/resources folder. This file indicates properties such as the URLs to the JavaScript API and map viewer that will be used by the Services Directory. In a multiple-machine site, edits to this file should be made on each GIS server that participates in the site.

Cross Origin Access

If the client includes a “Origin” header in the request, the REST instance will determine if this origin has cross-domain access or not. If it has access, then it will include an “Access-Control-Allow-Origin” header in the response and the value will simply echo the value of the “Origin” header. If it does not have access, it will not include this response header.

By default, the REST API will allow access to all domains. To restrict access, users need to specify a new allowedOrigins property in the rest config. The value should be a comma-delimited list of allowed domains.

From 10.1 SP1 onwards, ArcGIS Server token service supports Cross Origin Access and will always allow access to all domains.

Example: allowedOrigins=http://foo, http://bar:9090

JavaScript API URLs

Services Directory gives you the ability to view Map and Image services using the ArcGIS JavaScript API. You can configure the URLs to various resources for this library using the properties in discussed here.

A typical configuration of the JavaScript API URLs would look like this:

jsapi.arcgis.css= URL

Using View in Map link in the Services Directory you can view Map, Image and Feature Services in map viewer. By default Services Directory is configured to use the map viewer in You can update the property to configure Services Directory to use a map viewer from a different portal. The property can be used to configure the text that will be shown for the View In link in the Services Directory. Map

REST API Logging

Logging in the REST API can be configured using the ArcGIS Server Manager.

Maximum Upload Size

Since 10.1 the maximum allowed size of a multipart request for uploading files is a service level property <MaxUploadFileSize>. This limit, for example, applies to files uploaded using Uploads API or the Feature Service Add Attachment and Update Attachment operations. See section limiting Upload file size and file types to learn more.