unable to use the generated token on the http request

839
1
07-13-2017 06:01 AM
JudeRegev
New Contributor

i have tried to create a token using get request like this:

https://www.arcgis.com/sharing/generateToken?username=????&password=??&referer=www.jointer.co&expira...

i get a token as a response 

{"token":"???-??-JVXl73TwrkGdHN_UCe0RqzMAg8LzSOrg..","expires":1499954199890,"ssl":false}

I copied to token into the http request

https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver/Geoenrichment/Enrich?stu...[{"geometry":{"x": -122.435, "y": 37.785} ,"areaType":"RingBuffer", "bufferUnits":"esriMiles", "bufferRadii":[1,3,5] }] &analysisvariables=[{"KeyGlobalFacts.TOTPOP","itemid":"YourItemID","url":"www.arcgis.com","token":"???-??-JVXl73TwrkGdHN_UCe0RqzMAg8LzSOrg.."}]&f=pjson

and got the response :

{
      "error" :

         {
                "code" : 401,
                  "message" : "You do not have permissions to use this resource.",
                    "details" : [ ]
          }
}

0 Kudos
1 Reply
DanielStauning
Esri Contributor

Hi Jude,

It looks like your token is valid, however, your account doesn't have permissions to use Geoenrichment. Do you know what role your account has? Is it at least a publisher role? We'll need to have your org administrator check your role to see if you have permissions. It may be that you only have a user role or a custom role without permissions for Geoenrichment. 

-Dan

0 Kudos