<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Save items as json with ArcGIS API for Pyhton in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/1016269#M5415</link>
    <description>&lt;P&gt;Not sure what you mean by saying 'reimport'...&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you mean creating an item using the JSON you've got, yes you can. here is an example:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/technical-article/000019701" target="_self"&gt;How To: Create a web map from a JSON file using ArcGIS API for Python&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jan 2021 05:50:48 GMT</pubDate>
    <dc:creator>simoxu</dc:creator>
    <dc:date>2021-01-13T05:50:48Z</dc:date>
    <item>
      <title>Save items as json with ArcGIS API for Pyhton</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/763879#M454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to save the items-information as JSON like the JSON we could see with&amp;nbsp;&lt;A class="link-titled" href="https://ago-assistant.esri.com/" title="https://ago-assistant.esri.com/"&gt;ArcGIS Online Assistant&lt;/A&gt;?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Espacially I would like to store the "Web Map"-json to backup this information.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 14:11:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/763879#M454</guid>
      <dc:creator>GISMountains</dc:creator>
      <dc:date>2017-04-19T14:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Save items as json with ArcGIS API for Pyhton</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/763880#M455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You certainly can, checkout the &lt;A href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.html?highlight=get_data#arcgis.gis.Item.get_data" rel="nofollow noopener noreferrer" target="_blank"&gt;`get_data()`&lt;/A&gt; method available on an `Item` object. You can make the `try_json` argument to False so you always download the JSON data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ArcGIS Online Assistant shows you both the item properties as JSON as well as the data resource as JSON. The `get_data()` gives you the latter. To get the item's properties as JSON, cast the Item object as a dictionary like below and write that to a file:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; json
my_item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;search&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Web Map"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
dict_my_item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; dict&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;my_item&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; open &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"path_to_webmap_json_file.json"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"w"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; file_handle&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; file_handle&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;write&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;json&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dumps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dict_my_item&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:27:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/763880#M455</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T08:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Save items as json with ArcGIS API for Pyhton</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/763881#M456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once you get the json config data files for webmaps/webapps exported/backed up, is there a way to reimport them? I was looking at the additem or addpart API calls. What is the best way to do that?&lt;/P&gt;&lt;P&gt;Also, I know that I'll have to deal with updating the item IDs of web maps in the app configs (any ideas on best practices to do that)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can't wait until the ArcGIS online team can support backup/restore of entire orgs &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 15:22:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/763881#M456</guid>
      <dc:creator>DavidRunneals2</dc:creator>
      <dc:date>2019-08-09T15:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Save items as json with ArcGIS API for Pyhton</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/1016269#M5415</link>
      <description>&lt;P&gt;Not sure what you mean by saying 'reimport'...&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you mean creating an item using the JSON you've got, yes you can. here is an example:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/technical-article/000019701" target="_self"&gt;How To: Create a web map from a JSON file using ArcGIS API for Python&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 05:50:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/1016269#M5415</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2021-01-13T05:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Save items as json with ArcGIS API for Pyhton</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/1032282#M5634</link>
      <description>&lt;P&gt;Worked for me thank you!!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 00:43:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/save-items-as-json-with-arcgis-api-for-pyhton/m-p/1032282#M5634</guid>
      <dc:creator>SolanaFoo2</dc:creator>
      <dc:date>2021-03-03T00:43:00Z</dc:date>
    </item>
  </channel>
</rss>

