interpolation using API REST

5050
6
Jump to solution
12-29-2014 02:57 AM
AidaMonfort_Muriach
New Contributor

Hello I would like to use the API REST to interpolate a set of points stored in an ArcGIS Online layer.


I'm using this URL:

http: //www.arcgis.com/sharing/rest/content/features/analyze/InterpolatePoints/submitJob?token=ValidToken&url=67421744b8b549b49b5fb45ff836d45f&field=aqi&f=json


With a valid Token and in the url parameter the id of my points layer. But I get this result: {"error":{"code":400,"message":"Must specify either sourceUrl, input file or text."}}


How should I specify the input parameter if I want to use my layer stored in ArcGIS Online?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
HeikoHeijenga
Esri Contributor

You're using the wrong endpoint. If you go through ArcGIS REST API: Spatial Analysis Service | ArcGIS for Developers  you'll see references to for example http://<analysis url>/InterpolatePoints, <analysis url> is your GP Server endpoint. Typically with an ArcGIS Online account this is analysis.arcgis.com/arcgis/rest/services/tasks/GPServer. So to submit an interpolate points request you would use http://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer/InterpolatePoints/submitJob

View solution in original post

6 Replies
HeikoHeijenga
Esri Contributor

You're using the wrong endpoint. If you go through ArcGIS REST API: Spatial Analysis Service | ArcGIS for Developers  you'll see references to for example http://<analysis url>/InterpolatePoints, <analysis url> is your GP Server endpoint. Typically with an ArcGIS Online account this is analysis.arcgis.com/arcgis/rest/services/tasks/GPServer. So to submit an interpolate points request you would use http://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer/InterpolatePoints/submitJob

View solution in original post

AidaMonfort_Muriach
New Contributor

Thanks for your answer, I changed the endpoint and now I getting this error:

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

My layer is public, and the token is valid, do you know what could be the problem?

0 Kudos
HeikoHeijenga
Esri Contributor

The analysis services consume credits, so you would need an organizational account and be authorized by your admin to use these services...

0 Kudos
AidaMonfort_Muriach
New Contributor

I'm in an organizational account, I didn't know I should be authorized to use the service.

Thank you!

0 Kudos
HeikoHeijenga
Esri Contributor

You can check by going to https://arcgistest.maps.arcgis.com/sharing/rest/portals/self?f=pjson&token=<token>‌ and verify you have the "premium:user:spatialanalysis" privilege:

privileges.png

(of course use your own org. url instead of arcgistest.maps.arcgis.com)

AidaMonfort_Muriach
New Contributor

Yes, I'm missing it.

Thanks!

0 Kudos