<?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: Using Python API to create and query a restricted and unfederated feature service in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/using-python-api-to-create-and-query-a-restricted/m-p/830501#M3170</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nevermind - just realized there is a arcgis.gis.server module that solves my issue.&amp;nbsp; Figured it out.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d;"&gt;gis = arcgis.gis.server.Server("https://myserver.domain.com/restricted/admin"&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d;"&gt;, username=username, password=password)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d;"&gt;fl = arcgis.features.FeatureLayer(featurelayerurl, gis=gis).query()&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jun 2020 17:47:22 GMT</pubDate>
    <dc:creator>Jay_Gregory</dc:creator>
    <dc:date>2020-06-18T17:47:22Z</dc:date>
    <item>
      <title>Using Python API to create and query a restricted and unfederated feature service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/using-python-api-to-create-and-query-a-restricted/m-p/830500#M3169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm aware of how to use the Python API to authenticate to a GIS and then create a FeatureLayer from a feature service to query or extract data from.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I can't seem to figure out how to do the same when there is no underlying Portal.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The feature service in question is restricted, but I am able to login and traverse the REST endpoints from my browser.&amp;nbsp; Similarly, I can (using Python) generate a token from the Server's generateToken endpoint.&amp;nbsp; However, since the server is not federated, I am not able to use the Python API to get access to the underlying feature services:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For my example: say my REST endpoints are at: https://myserver.domain.com/restricted/rest/services&lt;/P&gt;&lt;P&gt;Example code:&lt;/P&gt;&lt;P&gt;gis = GIS("&lt;SPAN&gt;https://myserver.domain.com/restricted&lt;/SPAN&gt;", username=username, password=password) - generates an error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fl = arcgis.features.FeatureLayer("&lt;SPAN&gt;&lt;A href="https://myserver.domain.com/restricted/rest/services/myservice/0&amp;quot;"&gt;https://myserver.domain.com/restricted/rest/services/myservice/0"&lt;/A&gt;).query() - also generates an error.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried generating a token and then passing it in to both the Feature layer or the GIS and nothing seems to work.&amp;nbsp; Is there any workaround here I'm missing?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2020 17:39:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/using-python-api-to-create-and-query-a-restricted/m-p/830500#M3169</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2020-06-18T17:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python API to create and query a restricted and unfederated feature service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/using-python-api-to-create-and-query-a-restricted/m-p/830501#M3170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nevermind - just realized there is a arcgis.gis.server module that solves my issue.&amp;nbsp; Figured it out.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d;"&gt;gis = arcgis.gis.server.Server("https://myserver.domain.com/restricted/admin"&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d;"&gt;, username=username, password=password)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d;"&gt;fl = arcgis.features.FeatureLayer(featurelayerurl, gis=gis).query()&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2020 17:47:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/using-python-api-to-create-and-query-a-restricted/m-p/830501#M3170</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2020-06-18T17:47:22Z</dc:date>
    </item>
  </channel>
</rss>

