Select to view content in your preferred language

Analaysis server saying anonymous access not allowed even with valid token/permissions

1279
1
Jump to solution
02-27-2021 07:09 AM
DannyBritt1
Emerging Contributor

I need to programmatically call the analysis extract data endpoint (https://developers.arcgis.com/rest/analysis/api-reference/extract-data.htm). I've written client side and server side code in js/node and I can't seem to get either approach to work. 

On the client side, I get CORS issues, and in the nodejs code, the endpoint responds saying that anonymous access isn't allowed.  I am using a valid token and I'm using an account that is able to use this tool from the webmap viewer, so I assume my permissions are valid as well.

I'm trying to hit: https://analysis5.arcgis.com/arcgis/rest/services/tasks/GPServer/ExtractData/submitJob because this is the URL that I saw the webmap viewer was using. Although I've also tried other instances of this service (analysis, analysis1, analysis2, etc).

I've created a github repo with the code: https://github.com/danbritt/data-extractor-example 

Any help would be appreciated, as this is an important tool that I want to provide in a project I'm working on.

Tags (3)
1 Solution

Accepted Solutions
DannyBritt1
Emerging Contributor

Figured it out. This endpoint only accepts application/x-www-form-urlencoded requests, and I was sending JSON, so it didn't see any of the parameters I was passing, including the token.

View solution in original post

0 Kudos
1 Reply
DannyBritt1
Emerging Contributor

Figured it out. This endpoint only accepts application/x-www-form-urlencoded requests, and I was sending JSON, so it didn't see any of the parameters I was passing, including the token.

0 Kudos