<?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: Exception: You do not have permissions to access this resource or perform this operation. (Error Code: 403) in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-you-do-not-have-permissions-to-access/m-p/1328399#M8999</link>
    <description>&lt;P&gt;I received the same error today and fixed it with 2 modifications.&lt;BR /&gt;I was logged into a different portal within AGP. Changing that removed the error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like in your example, I was using gis("home") which apparently uses the active portal set in AGP.&amp;nbsp;&lt;BR /&gt;Since then, I updated the script to explicitly specify the portal.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 17:24:26 GMT</pubDate>
    <dc:creator>GabrielMarcus_C</dc:creator>
    <dc:date>2023-09-13T17:24:26Z</dc:date>
    <item>
      <title>Exception: You do not have permissions to access this resource or perform this operation. (Error Code: 403)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-you-do-not-have-permissions-to-access/m-p/1305146#M8840</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am the administrator of an AGOL account, but when I run this script, I get a 403 error. How is it possible and any idea how I can solve this?&lt;BR /&gt;&lt;BR /&gt;from arcgis.gis import GIS&lt;BR /&gt;from arcgis import features&lt;BR /&gt;from datetime import date&lt;BR /&gt;import pandas as pd&lt;BR /&gt;import os&lt;BR /&gt;import io&lt;BR /&gt;import requests&lt;BR /&gt;gis = GIS("Home")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Specify the item ID of the map&lt;BR /&gt;map_item_id = "470e800329c9490fba5e43f9ba7faef1"&lt;/P&gt;&lt;P&gt;# Retrieve the map item&lt;BR /&gt;map_item = gis.content.get(map_item_id)&lt;/P&gt;&lt;P&gt;# Retrieve the layers from the map item&lt;BR /&gt;map_layers = map_item.get_data()['operationalLayers']&lt;/P&gt;&lt;P&gt;# Extract only the titles of the feature layers&lt;BR /&gt;layer_titles = [layer['title'] for layer in map_layers if layer['layerType'] == 'ArcGISFeatureLayer']&lt;/P&gt;&lt;P&gt;# Print the layer titles&lt;BR /&gt;print(layer_titles)&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2023 15:14:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-you-do-not-have-permissions-to-access/m-p/1305146#M8840</guid>
      <dc:creator>IB3</dc:creator>
      <dc:date>2023-07-01T15:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: You do not have permissions to access this resource or perform this operation. (Error Code: 403)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-you-do-not-have-permissions-to-access/m-p/1305370#M8841</link>
      <description>&lt;P&gt;Is the item set to private and owned by another user? If so then I would ask them to share this to the organisation or to a group and invite you to this.&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 16:11:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-you-do-not-have-permissions-to-access/m-p/1305370#M8841</guid>
      <dc:creator>David_McRitchie</dc:creator>
      <dc:date>2023-07-03T16:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: You do not have permissions to access this resource or perform this operation. (Error Code: 403)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-you-do-not-have-permissions-to-access/m-p/1328399#M8999</link>
      <description>&lt;P&gt;I received the same error today and fixed it with 2 modifications.&lt;BR /&gt;I was logged into a different portal within AGP. Changing that removed the error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like in your example, I was using gis("home") which apparently uses the active portal set in AGP.&amp;nbsp;&lt;BR /&gt;Since then, I updated the script to explicitly specify the portal.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 17:24:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-you-do-not-have-permissions-to-access/m-p/1328399#M8999</guid>
      <dc:creator>GabrielMarcus_C</dc:creator>
      <dc:date>2023-09-13T17:24:26Z</dc:date>
    </item>
  </channel>
</rss>

