Select to view content in your preferred language

Am I able to delete an offline map area through the REST API

245
2
Jump to solution
08-19-2024 06:38 AM
Labels (1)
Gravixx
Emerging Contributor

Hi,

I have implemented being able to create map areas through the REST API in my application, and was wondering if it was possible to delete these areas once I am done with them through the REST API, without having to go to the map item on the arcgis website.

The URL i used to create the item is: https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/CreateMapArea/submitJob

0 Kudos
1 Solution

Accepted Solutions
Tyler_M
Esri Contributor

Hey @Gravixx , I hope you are doing well!

 

There is a way to do this sending the deleteItems REST operation as a POST request if we know the offline Map Area's Item ID! 

 

We can specify the Map Area's item ID in the items parameter in the deleteItems request, append a token, and an output format (f), and it will delete the offline area through REST

 

I think there may be a better way to retrieve Map Area's item ID, but here's an example of doing it programmatically through the ArcGIS API for Python: https://community.esri.com/t5/arcgis-field-maps-questions/can-you-delete-offline-areas-with-python/m...

 

We can also retrieve Map Area's item IDs using ArcGIS Assistant: https://assistant.esri-ps.com/

 

Thank you!

 

Documentation:
ArcGIS REST APIs - /deleteItems: Delete Items
https://developers.arcgis.com/rest/users-groups-and-items/delete-items/

View solution in original post

0 Kudos
2 Replies
Tyler_M
Esri Contributor

Hey @Gravixx , I hope you are doing well!

 

There is a way to do this sending the deleteItems REST operation as a POST request if we know the offline Map Area's Item ID! 

 

We can specify the Map Area's item ID in the items parameter in the deleteItems request, append a token, and an output format (f), and it will delete the offline area through REST

 

I think there may be a better way to retrieve Map Area's item ID, but here's an example of doing it programmatically through the ArcGIS API for Python: https://community.esri.com/t5/arcgis-field-maps-questions/can-you-delete-offline-areas-with-python/m...

 

We can also retrieve Map Area's item IDs using ArcGIS Assistant: https://assistant.esri-ps.com/

 

Thank you!

 

Documentation:
ArcGIS REST APIs - /deleteItems: Delete Items
https://developers.arcgis.com/rest/users-groups-and-items/delete-items/

0 Kudos
Gravixx
Emerging Contributor

Thankyou for the response! I've run into another issue when packaging offline map areas through the REST API, it just stays packaging for days even when its just a 1km by 1km area thats being packaged. Would you have any idea why? Again thankyou for the help with the deletion request.

0 Kudos