- 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 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 generate operation in the Portal Directory API. For security reasons, all POST requests made to the Server Administrator API must include a token in the request body.
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 Map Viewer Classic previews of services in the Services Directory so that they work with your own locally hosted JavaScript API and Map Viewer Classic.
Request parameters
| Parameter | Details |
|---|---|
| The flag to enable or disable the HTML view of the services directory. The default value is Values: |
| 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 ( Values: |
| A comma-separated list of URLs of domains allowed to make requests. Example |
| 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 |
| The CSS file associated with the ArcGIS API for JavaScript. Defaults to the online Example Example |
| The URL of the ArcGIS API for JavaScript help. Example |
| The text to use for the preview link that opens Map Viewer Classic. Example |
| The URL to use for the preview link to open Map Viewer Classic. The defaults URL is to ArcGIS Online's Map Viewer Classic but could be used to point at your ArcGIS Enterprise portal's Map Viewer Classic. Example |
| The response format. The default response format is Values: |
Example usage
The following is a sample POST request for the edit operation:
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 Online Map Viewer&arcgis.com.map=https://www.arcgis.com/home/webmap/viewer.html&f=pjsonJSON Response example
{"status": "success"}