Create Map Area using packaging.arcgis.com

1549
5
Jump to solution
03-13-2018 04:09 AM
Raul_Jimenez
Esri Contributor

I'm trying to follow the documentation on this page: Create Map Area—ArcGIS REST API: Packaging Service | ArcGIS for Developers but I get an "Services Directory has been disabled" error message.

I have tried with this WebMap, using POST: 

curl -X POST \
'https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer' \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F mapItemId=4965122d0a9c4ea187fa643cda58c670 \
-F token=MY_TOKEN_HERE

And also GET:

curl -X GET \
'https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer?mapItemId=4965122d0a9c4e...MY_TOKEN_HERE' \

Am I doing something wrong?

Thanks in advance,

Raúl

cc: Patrick Arlt, John Gravois, Matthias Schenker, Paul Ross

0 Kudos
1 Solution

Accepted Solutions
RamunasKraujutis
New Contributor III

First, URL should be https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/CreateMapArea/submitJob

Second, in POST encode form parameters using "application/x-www-form-urlencoded" (instead of "multipart/form-data")

View solution in original post

5 Replies
RamunasKraujutis
New Contributor III

First, URL should be https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/CreateMapArea/submitJob

Second, in POST encode form parameters using "application/x-www-form-urlencoded" (instead of "multipart/form-data")

Raul_Jimenez
Esri Contributor

Thank you very much Ramunas Kraujutis‌, I have just tried this:

curl -X POST \
https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/CreateMapArea/submitJob \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'mapItemId=4965122d0a9c4ea187fa643cda58c670&token=MY_TOKEN_HERE'

But I'm still getting the same response, maybe I didn't understand your message, did I?

Cheers,

Raul

0 Kudos
RamunasKraujutis
New Contributor III

Try adding "f=json" to "-d 'f=json&mapItemId=4965122d0a9c4ea187fa643cda58c670&token=MY_TOKEN_HERE'"

Muhammad_YasirAli_Khan
New Contributor II

Sir, I m facing an issue at the very next stage of this packaging service "Setup Map Area". While submitting job went successful, it gives job failure error on the status check which I posted in this question.

https://community.esri.com/message/756213-error-in-executing-agol-rest-api-packaging-service 

Can you help me in figuring out how to set these parameters which I highlighted in red color.

0 Kudos
Raul_Jimenez
Esri Contributor

Thanks Ramunas Kraujutis‌!! it works now!

So finally I created this item: http://www.arcgis.com/home/item.html?id=444e615e7b9f471ab2a4c5d9194b538e#overview 

I have added this request to a Postman collection we started on Github.

Thanks again!