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?
Solved! Go to Solution.
Sure this is possible. Grab the data, modify it and do an update on the item
Sure this is possible. Grab the data, modify it and do an update on the item
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.
Thanks, this has lots of potentials in doing what is hard to achieve in the webmap GUI.
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