Select to view content in your preferred language

Calculate drive time polygons using ArcGIS Online and ArcGIS JavaScript API

3551
0
05-02-2013 08:03 AM
RyanStanley1
New Contributor
Our office wishes to create a public web map (using the JavaScript API) that allows users to determine drive time polygons from a given location.  The free ESRI service (http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Network/ESRI_DriveTime_US/GPServer) only allows a user to calculate 15 minute drive time polygons.  Our office has an ArcGIS Online account, so I want to use the Network Analysis Services and the Service Area Service (http://resources.arcgis.com/en/help/arcgis-online-network-analysis-rest-api/#/Service_Area_Service_w...) to create these polygons.

However, I am not sure how to generate a token for the application so we can use the Network Analysis Services.  End users should not be required to enter the credentials. Instead, the credentials should be stored on the server so a token can be generated automatically for each user that visits the web map.

I have tried requesting a token in my browser with this URL (https://www.arcgis.com/sharing/generateToken?username=yourUserName&password=yourPassword&referer=htt...) and my ArcGIS Online credentials, but the returned JSON response says �??Invalid username or password�?�. 
What am I doing wrong and how can I generate a token so I can use the Network Analysis Services available through ArcGIS online?  Any help would be greatly appreciated.

Thank you.
0 Kudos
0 Replies