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
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-p/1369311/highlight/true#M7731
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 Itemshttps://developers.arcgis.com/rest/users-groups-and-items/delete-items/
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.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.