<?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 Thumbnail error when adding item via Python API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784169#M1327</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a map service (ArcGIS Server 10.2.2) containing a number of layers, each of which I want to add to my Portal (10.5) via the Python API.&amp;nbsp; The server is not federated with the Portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I manually add the URL for the individual layer then it successfully creates a content item and automatically creates a thumbnail for me showing a snapshot of the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if I use the Python API to add the same URL into a different content item then a thumbnail is not generated. When I go to the content item in Portal it shows an error at the top of the page - see image below:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Error seen when trying to display a thumbnail for an item that has been added via the Python API" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/355020_thumbnail_error.JPG" style="width: 620px; height: 137px;" /&gt;&lt;/P&gt;&lt;P&gt;This disappears if I click anywhere near it but returns again if I refresh the page.&amp;nbsp; If I manually edit the thumbnail and upload an image from my PC then I don't see the error again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have two questions:&lt;/P&gt;&lt;P&gt;1. Is it possible for a thumbnail to be automatically generated for me when I create an item via the Python API?&lt;/P&gt;&lt;P&gt;2. If it can't be generated automatically then how can I specify an image file from my PC to be uploaded instead? Or can the image only be referenced by a URL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For info a sample of my code is below.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px;"&gt;layer_properties={&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;'title':'Test thumb',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;'description':Test description.',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;'snippet':Test summary.',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;'tags':test',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;'type':'Feature Service',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;SPAN&gt;&amp;nbsp;'url':'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmyserver%2Fmywebadaptor%2Frest%2Fservices%2Fenvironmental%2Fdesignations%2FMapServer%2F7" rel="nofollow" target="_blank"&gt;https://myserver/mywebadaptor/rest/services/environmental/designations/MapServer/7&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;myLayer = gis.content.add(item_properties=layer_properties)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;myLayer&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've looked at the API reference here but there is no example for me to follow&lt;BR /&gt;&lt;A href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.html#contentmanager"&gt;http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.html#contentmanager&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Jun 2017 14:37:55 GMT</pubDate>
    <dc:creator>GarethBaker1</dc:creator>
    <dc:date>2017-06-01T14:37:55Z</dc:date>
    <item>
      <title>Thumbnail error when adding item via Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784169#M1327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a map service (ArcGIS Server 10.2.2) containing a number of layers, each of which I want to add to my Portal (10.5) via the Python API.&amp;nbsp; The server is not federated with the Portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I manually add the URL for the individual layer then it successfully creates a content item and automatically creates a thumbnail for me showing a snapshot of the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if I use the Python API to add the same URL into a different content item then a thumbnail is not generated. When I go to the content item in Portal it shows an error at the top of the page - see image below:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Error seen when trying to display a thumbnail for an item that has been added via the Python API" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/355020_thumbnail_error.JPG" style="width: 620px; height: 137px;" /&gt;&lt;/P&gt;&lt;P&gt;This disappears if I click anywhere near it but returns again if I refresh the page.&amp;nbsp; If I manually edit the thumbnail and upload an image from my PC then I don't see the error again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have two questions:&lt;/P&gt;&lt;P&gt;1. Is it possible for a thumbnail to be automatically generated for me when I create an item via the Python API?&lt;/P&gt;&lt;P&gt;2. If it can't be generated automatically then how can I specify an image file from my PC to be uploaded instead? Or can the image only be referenced by a URL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For info a sample of my code is below.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px;"&gt;layer_properties={&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;'title':'Test thumb',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;'description':Test description.',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;'snippet':Test summary.',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;'tags':test',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;'type':'Feature Service',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;SPAN&gt;&amp;nbsp;'url':'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmyserver%2Fmywebadaptor%2Frest%2Fservices%2Fenvironmental%2Fdesignations%2FMapServer%2F7" rel="nofollow" target="_blank"&gt;https://myserver/mywebadaptor/rest/services/environmental/designations/MapServer/7&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&amp;nbsp;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;myLayer = gis.content.add(item_properties=layer_properties)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;myLayer&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've looked at the API reference here but there is no example for me to follow&lt;BR /&gt;&lt;A href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.html#contentmanager"&gt;http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.html#contentmanager&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 14:37:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784169#M1327</guid>
      <dc:creator>GarethBaker1</dc:creator>
      <dc:date>2017-06-01T14:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Thumbnail error when adding item via Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784170#M1328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can request the server to create a thumbnail using the&amp;nbsp;&lt;A href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.mapping.html#arcgis.mapping.export_map"&gt;export_map method&lt;/A&gt;. Once you have a thumbnail, either through export_map or a file on local disk, you can specify that in the 'thumbnail' argument of the 'add' method. Refer to this api reference:&amp;nbsp;&lt;A href="http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.html#arcgis.gis.ContentManager.add"&gt;arcgis.gis.ContentManager.add&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternately, you can update an existing item and specify the thumbnail. Refer to this example:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/managing-your-content/#Updating-item-properties" title="https://developers.arcgis.com/python/guide/managing-your-content/#Updating-item-properties"&gt;managing your content | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jun 2017 16:55:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784170#M1328</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-06-01T16:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Thumbnail error when adding item via Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784171#M1329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Atma. I think your second link to the API reference is probably the same as I put at the bottom of my original question.&amp;nbsp; My comment about not having a useful worked example on that page is I think still valid but thankfully the managing your content example has useful guidance on how to specify a path on my local PC for the thumbnail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jun 2017 09:27:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784171#M1329</guid>
      <dc:creator>GarethBaker1</dc:creator>
      <dc:date>2017-06-02T09:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Thumbnail error when adding item via Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784172#M1330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gareth, we are working toward refining&amp;nbsp;the API ref doc and will take this into consideration. Meanwhile, I could have sent you this guide topic:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/accessing-and-creating-your-content/#Creating-new-content" title="https://developers.arcgis.com/python/guide/accessing-and-creating-your-content/#Creating-new-content"&gt;Accessing and creating content | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;which explains how to set a thumbnail at the time of creating a new item. Was this something you were looking for originally?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jun 2017 17:18:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784172#M1330</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-06-02T17:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Thumbnail error when adding item via Python API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784173#M1331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Atma. I did see that page&amp;nbsp;during my initial research but disregarded it because it didn't specifically mention adding a content item from a loosely coupled ArcGIS Server via URL.&amp;nbsp; With the benefit of hindsight I can see that the thumbnail example would have been useful despite it relating to a CSV file in that case.&amp;nbsp; Thanks for all your speedy replies on the matter, very helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 08:34:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/thumbnail-error-when-adding-item-via-python-api/m-p/784173#M1331</guid>
      <dc:creator>GarethBaker1</dc:creator>
      <dc:date>2017-06-05T08:34:29Z</dc:date>
    </item>
  </channel>
</rss>

