AnsweredAssumed Answered

Learning the host server url by using the REST API

Question asked by Zeno_10 on Oct 4, 2019



My feature service URL's are like this:

"[Organization ID]/arcgis/rest/services/[Feature Service Name]/FeatureServer"



Why does my organization have this server url, namely ""? Why is it "services1"? Why not "services2" or "services3"? Can this server url be different for different organizations that have an ArcGISOnline account?



Related, but a different question. I want to learn this host server url only via Rest API.[My Username]/

I can use the url above to get the content (that is, all items) in my account, find a service (for example, feature service, tile service etc.), and get the URL of that specific service. From the URL of that service, I can figure out the host service URL. However, if I don't have any service in my content, there seems to be no way to learn the host server URL by using the REST API.



Just an example to clarify what I mean. Let's assume that I know the username and password of a specific user on ArcGISOnline. By using this information, I can generate a token. By using this token, I can do lots of things, such as displaying the items on his content, learning which groups he is a member of, upload an item to his content, creating a feature service etc. However, I want to learn the URL of the server in which his feature services exist. More specifically, I want to learn the <host> part of its ARCGIS Server endpoint URL structure which you can see in the below documentation:

Get started—ArcGIS REST API: Services Directory | ArcGIS for Developers 


How can I do that?