Network Analysis Services

373
1
05-12-2013 02:43 PM
ShaunWeston
Occasional Contributor
I'm trying to start do some testing around the network analysis services and have looked at the documentation around this and done the following to try get access to the closest facility service:

- We have an ArcGIS Online subscription for Organisations
- Request a token to the service by doing the following request - https://www.arcgis.com/sharing/generateToken?username=username&password=password&referer=webserver&e...
- This returns a token to use
- I've then tried to test this token from the webserver using either this - http://route.arcgis.com/arcgis/rest/services/World/ClosestFacility/NAServer/ClosestFacility_World?to...
or
this - http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve?token=yjijnwM3id...

But both return invalid token?

I'd also like to test from my machine, so tried putting in my IP addres for the referer when requesting the token, but that returned invalid token too.

Would someone be able to provide some steps on how to test using the ArcGIS Online network services?
Tags (2)
0 Kudos
1 Reply
ShaunWeston
Occasional Contributor
Oh I just noticed this in the documentation:

If you copy and paste the request URL from the examples into a web browser, you will get a invalid token error message. Even if you replace yourToken in the request URL with a valid token that you obtained using your credentials, you will still get the invalid token message. Submitting requests to the service directly using a web browser is not supported. You need to construct a similar request in the API you have chosen to build your application.

So, I assume if I setup the request through the Javascript API it will work.
0 Kudos