<?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: Not Able to Get Portal Item Properties and Resource Using ArcGIS API for Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/not-able-to-get-portal-item-properties-and/m-p/1539106#M10673</link>
    <description>&lt;P&gt;I found this works with layers but not with items.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;print(json.dumps(dict(item), indent=4))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 19:33:19 GMT</pubDate>
    <dc:creator>RandyMcGregor_BMcD</dc:creator>
    <dc:date>2024-09-16T19:33:19Z</dc:date>
    <item>
      <title>Not Able to Get Portal Item Properties and Resource Using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/not-able-to-get-portal-item-properties-and/m-p/1369886#M9516</link>
      <description>&lt;P&gt;Having an array of Portal Items like&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p_items = ['9912a5ec3325460ab88010cfefddwr21',
           '9251s4de1s1460ab88010cfe64seyus', 
           'ssdf2a5ec3325541dgs10cfefd21syx'
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to retrieve two properties of&amp;nbsp; &amp;nbsp;Type of Items weather is (&lt;SPAN&gt;&lt;STRONG&gt;Feature Layer (hosted, view)&lt;/STRONG&gt;&amp;nbsp;,or&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Feature Layer (hosted)&lt;/STRONG&gt;, or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;Map Image Layer&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BHK_0-1705110696010.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/91507iFF94CF4FF886B0F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BHK_0-1705110696010.png" alt="BHK_0-1705110696010.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and also, the &lt;STRONG&gt;URL&lt;/STRONG&gt; referring into the source (ArcGIS Server Feature Service)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BHK_1-1705110713054.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/91508i831F039A55FA2DBC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BHK_1-1705110713054.png" alt="BHK_1-1705110713054.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already tried this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p_items = ['9912a5ec3325460ab88010cfefddwr21',
           '9251s4de1s1460ab88010cfe64seyus', 
           'ssdf2a5ec3325541dgs10cfefd21syx'
]
for item in p_items:
    item_id = item
    p_item = gis.content.get(item_id)
    item_resource = p_item.resources.list()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the &lt;STRONG&gt;`item_resource`&amp;nbsp;&lt;/STRONG&gt;is always empty! Can you please let me know what I am missing here and how I can achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2024 01:58:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/not-able-to-get-portal-item-properties-and/m-p/1369886#M9516</guid>
      <dc:creator>BHK</dc:creator>
      <dc:date>2024-01-13T01:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Not Able to Get Portal Item Properties and Resource Using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/not-able-to-get-portal-item-properties-and/m-p/1369909#M9518</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/671830"&gt;@BHK&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You get this information from the JSON of the item object. Run the code below to print out the properties of an item.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
import json

agol = GIS("home")

item_id = "ITEM_ID"
item = agol.content.get(item_id)
print(json.dumps(dict(item), indent=4))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the &lt;STRONG&gt;type&lt;/STRONG&gt; and &lt;STRONG&gt;typeKeywords&lt;/STRONG&gt; you will find the information your are looking for. It is not always obvious but your Feature Service and View will be of &lt;STRONG&gt;type&lt;/STRONG&gt; &lt;EM&gt;&lt;STRONG&gt;Feature Service&lt;/STRONG&gt;&lt;/EM&gt;, the view will have a &lt;STRONG&gt;typeKeyword&lt;/STRONG&gt; of&lt;EM&gt;&lt;STRONG&gt; View Service &lt;/STRONG&gt;&lt;/EM&gt;in the list. The Map Image Layer will have a &lt;STRONG&gt;type&lt;/STRONG&gt; of&lt;EM&gt;&lt;STRONG&gt; Map Service&lt;/STRONG&gt;&lt;/EM&gt;. Use the below to print out the &lt;STRONG&gt;type&lt;/STRONG&gt; and &lt;STRONG&gt;typeKeywords&lt;/STRONG&gt;&amp;nbsp;properties for an item and the &lt;STRONG&gt;url&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
import json

agol = GIS("home")

p_items = ["ITEM_ID1", "ITEM_ID2", "ITEM_ID3"]

for item_id in p_items:
    item = agol.content.get(item_id)
    print(item["type"])
    print(item["typeKeywords"])
    print(item["url"])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This link is useful for &lt;STRONG&gt;type&lt;/STRONG&gt; and &lt;STRONG&gt;typeKeyword&lt;/STRONG&gt; combinations:&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types.htm" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2024 09:15:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/not-able-to-get-portal-item-properties-and/m-p/1369909#M9518</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2024-01-13T09:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Not Able to Get Portal Item Properties and Resource Using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/not-able-to-get-portal-item-properties-and/m-p/1539106#M10673</link>
      <description>&lt;P&gt;I found this works with layers but not with items.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;print(json.dumps(dict(item), indent=4))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 19:33:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/not-able-to-get-portal-item-properties-and/m-p/1539106#M10673</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-09-16T19:33:19Z</dc:date>
    </item>
  </channel>
</rss>

