Skip to content
URL:
https://<root>/system/handlers/rest/servicesdirectory/edit
Methods:
POST
Version Introduced:
10.1

Access requirements

Required privileges

The Sever Administrator API requires privilege-based access. An administrator must be assigned a specific user privilege, or role, to access any given endpoint. Listed below are the user privileges or roles an administrator can be assigned that provides access to this endpoint. If multiple privileges are listed, only one needs to be assigned to gain access.



Note that administrators assigned a custom role must also have the administrative View all content privilege assigned to them to access the API directory as an administrator.

Tokens

This API requires token-based authentication. A token is automatically generated for administrators who sign in to the ArcGIS Server Administrator API directory's HTML interface. Tokens generated in this way are stored for the entirety of the session.

Those accessing the API directory outside of the HTML interface will need to acquire a session token from the ArcGIS Server Administrator API generateToken operation. For security reasons, all POST requests made to the ArcGIS Server Administrator API must include a token in the request body.


Learn how to generate a token

Description

The edit operation allows you to enable or disable the HTML view of the Services Directory REST API. You can also adjust the JavaScript and ArcGIS Enterprise Map Viewer previews of services in the Services Directory so that they work with your own locally hosted JavaScript API and ArcGIS Enterprise Map Viewer.

Request parameters

ParameterDetails

servicesDirEnabled

The flag to enable or disable the HTML view of the services directory. The default value is true, enabling the services directory HTML view.

Values: true | false

callbackFunctionsEnabled

Introduced at 11.0. The flag to enable or disable the ability to make JSONP callback requests. The JSONP callback feature is enabled by default (true) and allows older clients a way to make CORS requests without being restricted by the same-origin policy. This is useful for older browsers or other clients that do not supports CORS requests.

Values: true | false

allowedOrigins

A comma-separated list of URLs of domains allowed to make requests. * can be used to denote all domains.

Example
Use dark colors for code blocksCopy
1
allowedOrigins=*

jsapi.arcgis

The URL of the JavaScript API to use for service previews. Defaults to the online ArcGIS API for JavaScript, but could be pointed at your own locally-installed instance of the JavaScript API.

Example
Use dark colors for code blocksCopy
1
jsapi.arcgis=https://js.arcgis.com/4.11/

jsapi.arcgis.css

The CSS file associated with the ArcGIS API for JavaScript. Defaults to the online Dojo tundra.css.

Example

Example
Use dark colors for code blocksCopy
1
jsapi.arcgis.css=https://js.arcgis.com/4.11/esri/css/main.css

jsapi.arcgis.sdk

The URL of the ArcGIS API for JavaScript help.

Example
Use dark colors for code blocksCopy
1
jsapi.arcgis.sdk=https://help.arcgis.com/en/webapi/javascript/arcgis/

arcgis.com.map.text

The text to use for the preview link that opens ArcGIS Enterprise Map Viewer.

Example
Use dark colors for code blocksCopy
1
arcgis.com.map.text=ArcGIS Enterprise Map Viewer

arcgis.com.map

The URL to use for the preview link to open ArcGIS Enterprise Map Viewer.

Example
Use dark colors for code blocksCopy
1
arcgis.com.map=https://www.organization.example.com/<context>/apps/mapviewer/index.html

f

The response format. The default response format is html.

Values: html | json | pjson

Example usage

The following is a sample POST request for the edit operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /<context>/admin/system/handlers/rest/servicesdirectory/edit HTTP/1.1
Host: organization.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

servicesDirEnabled=true&callbackFunctionsEnabled=true&allowedOrigins=*&jsapi.arcgis=https://js.arcgis.com/4.11/&jsapi.arcgis.sdk=http://help.arcgis.com/en/webapi/javascript/arcgis/&jsapi.arcgis.css=https://js.arcgis.com/4.11/esri/css/main.css&arcgis.com.map.text=ArcGIS Enterprise Map Viewer&arcgis.com.map=https://www.organization.example.com/<context>/apps/mapviewer/index.html&f=pjson

JSON Response example

Use dark colors for code blocksCopy
1
{"status": "success"}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.