Hello,
I'd like to use ArcGIS Online analysis services in my web app application.
When I try accessing the service: http://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer?f=pjson&token=
I get this error:
{ "error" : { "code" : 401, "message" : "You do not have permissions to use this resource.", "details" : [ ] } }
When I check the privileges of my ArcGIS Online app using: https://.maps.arcgis.com/sharing/rest/portals/self?f=pjson&token=
I don't see analysis privilege in appInfo section:
"appInfo": { "appId": "-------", "itemId": "----------", "appOwner": "----", "orgId": "------", "appTitle": "myApp", "privileges": [ "premium:user:demographics", "premium:user:elevation", "premium:user:geocode", "premium:user:geoenrichment", "premium:user:networkanalysis" ] }
How can I add analysis privileges to my app?
Hello,
It looks like you are missing the spatial analysis privilege: premium:user:spatialanalysis.
Please contact your administrator and have them grant your role the ability to use Spatial Analysis under the GeoServices privileges.
Here is some further documentation about custom roles and configuring custom roles.
Let me know if this resolves the issue.
Kelly
I'm an administrator. So I'm supposed to have all privileges.
I tried with an Editor account too and I got the same output.
Editor role has the spatial analysis privilege.
I don't know what to do ...
Hello,
That is a strange behaviour. I would suggest contacting Esri Technical Support to look into this further.
After further research, it looks like this issue isn't related to permissions, but is related to the analysis service that you are accessing. The URL for the analysis server can change from organization to organization, so it is important that you identify the URL that will work with your username and password if you are accessing the analysis service outside of the analysis widgets. (The analysis widgets will find the correct URL based on the username and password.)
Please use the following documentation to discover your analysis URL for your organization: https://developers.arcgis.com/rest/analysis/api-reference/programmatically-accessing-analysis-servic...
You will need to use this URL if you are making calls direct calls to the analysis services.
Please let me know if you have any questions,
Thanks,
Kelly