<?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 403 Error when overwriting feature layer in ArcGIS Online in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/403-error-when-overwriting-feature-layer-in-arcgis/m-p/1307790#M8870</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I'm attempting to overwrite a hosted layer that I own in ArcGIS Online using the arcgis.features.FeatureLayerCollection.manager.overwrite() method in Python. When I login to AGOL normally it redirects me to my organization's sign-in page so I'm using OAuth2.0 to authenticate in Python. When using my client_id and client_secret I can read my hosted layers but I'm unable to overwrite them. When attempting the below code I receive&amp;nbsp;a 403 Error.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;from arcgis.gis import GIS
    from IPython.display import display
    import os
    import glob
    import pandas as pd
    directory = r'G:/Shared drives/path/'
    file_pattern = '*.csv'
    latest_file = max(glob.glob(os.path.join(directory, file_pattern)), key=os.path.getctime)
    df = pd.read_csv(latest_file)

    from arcgis.features import FeatureLayerCollection
    gis = GIS("https://myorg.maps.arcgis.com", client_id = "XXXXXXXXXXXX", client_secret = "XXXXXXXXXXXXXX" ) 
    fs = gis.content.get('XXXXXXXXXXXXXXXXX') 
    fs = FeatureLayerCollection.fromitem(fs)
    
    fs.manager.overwrite(df)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;The feature layer also has editing enabled. Is it possible to overwrite or even publish a hosted feature layer using OAuth2.0 in ArcGIS API Python?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2023 22:45:12 GMT</pubDate>
    <dc:creator>JSS</dc:creator>
    <dc:date>2023-07-12T22:45:12Z</dc:date>
    <item>
      <title>403 Error when overwriting feature layer in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/403-error-when-overwriting-feature-layer-in-arcgis/m-p/1307790#M8870</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm attempting to overwrite a hosted layer that I own in ArcGIS Online using the arcgis.features.FeatureLayerCollection.manager.overwrite() method in Python. When I login to AGOL normally it redirects me to my organization's sign-in page so I'm using OAuth2.0 to authenticate in Python. When using my client_id and client_secret I can read my hosted layers but I'm unable to overwrite them. When attempting the below code I receive&amp;nbsp;a 403 Error.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;from arcgis.gis import GIS
    from IPython.display import display
    import os
    import glob
    import pandas as pd
    directory = r'G:/Shared drives/path/'
    file_pattern = '*.csv'
    latest_file = max(glob.glob(os.path.join(directory, file_pattern)), key=os.path.getctime)
    df = pd.read_csv(latest_file)

    from arcgis.features import FeatureLayerCollection
    gis = GIS("https://myorg.maps.arcgis.com", client_id = "XXXXXXXXXXXX", client_secret = "XXXXXXXXXXXXXX" ) 
    fs = gis.content.get('XXXXXXXXXXXXXXXXX') 
    fs = FeatureLayerCollection.fromitem(fs)
    
    fs.manager.overwrite(df)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;The feature layer also has editing enabled. Is it possible to overwrite or even publish a hosted feature layer using OAuth2.0 in ArcGIS API Python?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 22:45:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/403-error-when-overwriting-feature-layer-in-arcgis/m-p/1307790#M8870</guid>
      <dc:creator>JSS</dc:creator>
      <dc:date>2023-07-12T22:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Error when overwriting feature layer in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/403-error-when-overwriting-feature-layer-in-arcgis/m-p/1309173#M8879</link>
      <description>&lt;P&gt;It sounds you're encountering the &lt;A href="https://developers.arcgis.com/documentation/mapping-apis-and-services/security/application-credentials/#limitations-of-application-credentials" target="_self"&gt;Limitations of application credentials&lt;/A&gt;&amp;nbsp;which do not allow updating. You can Application logins are limited in what they can do. You can use Pro authentication to accomplish your workflow:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis = GIS("pro")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Jul 2023 16:42:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/403-error-when-overwriting-feature-layer-in-arcgis/m-p/1309173#M8879</guid>
      <dc:creator>JohnYaist1</dc:creator>
      <dc:date>2023-07-18T16:42:45Z</dc:date>
    </item>
  </channel>
</rss>

