Select to view content in your preferred language

Use custom Route service in application

100
2
a month ago
massimo
New Contributor

I built and published with ArcGIS Server (v. 10.9.1), installed on a server in our University GIS lab, a NAServer/Route service for route search and I would like to use it within a web application (written in js). To perform a test I created, as indicated in the Esri help, an 'API key' in ArcGIS Online. I copied the code of an example written for Leaflet, always taken from the Esri site, and assigned its value to the variable (accessToken) indicated in the code. Using the route service present in the code

"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve"

the execution of the app worked correctly, identifying the path between the indicated points. When I entered the url of the route service active on our ArcGIS Server, the execution produced more errors and warnings.

At this point my question is the following:

How can I use, within an application, the Route service that resides on our ArcGIS Server?

Thank you for your help.

Best regards

Massimo

0 Kudos
2 Replies
John-Foster
Esri Contributor

@massimo- An API key generated on ArcGIS Online will not work on your instance of ArcGIS Enterprise. You will have to generate a key on your server to access that servers resources. API keys were introduced on ArcGIS Enterprise at 11.4. In order to authenticate against your services, you will have to use a different authentication method, either user authentication or application authentication. See https://developers.arcgis.com/documentation/security-and-authentication/types-of-authentication/

 

--jf
0 Kudos
massimo
New Contributor

Thank you very much John for your reply. With your instructions I hope to complete the work.

Best regards

massimo