Select to view content in your preferred language

Edit or update ArcGIS Online Web Map data using the REST API

9219
4
Jump to solution
01-07-2015 01:39 PM
AdamMarinelli
Deactivated User

Web Map data is described on the ArcGIS REST API site under the Common data types section.  I am curious whether I can request the current JSON configuration as shown in the examples (using /data on the url), modify it, and POST it back?  As an example, I could request the web map data, add or modify the bookmarks list, and update the web map item online.  Does an operation or alternative exist for this?

Tags (3)
1 Solution

Accepted Solutions
HeikoHeijenga
Esri Contributor

Sure this is possible. Grab the data, modify it and do an update on the item

View solution in original post

4 Replies
HeikoHeijenga
Esri Contributor

Sure this is possible. Grab the data, modify it and do an update on the item

AdamMarinelli
Deactivated User

Perfect, thank you Heiko Heijenga.  I was not sure how to implement Update Item or what parameter to use to POST the data I was requesting and modifying.  I think I was confused between the Items common parameters (such as tags, title, type, etc.) and the actual content (data) of the item (bookmarks, extent, etc.).  The solution for me was after modifying the Item Data, I made a POST request with the JSON as the text parameter of the Update Item operation.

simoxu
by MVP Regular Contributor
MVP Regular Contributor

Thanks, this has lots of potentials in doing what is hard to achieve in the webmap GUI.

0 Kudos
jessemaps
Regular Contributor

This took me a few tries to get this to work, so I'm just going to post a couple things that helped me in case it helps someone else.

1. Make sure the ArcGIS Online item you're updating is in your root folder - thanks to dpettittva here.

2. While you fetch the web map's data with the item data url,

http://www.arcgis.com/sharing/rest/content/items/ITEM_ID/data

the update is done on the web map, not the web map data url. So my update POST url was:

http://www.arcgis.com/sharing/rest/content/users/USER_ID/items/ITEM_ID/update