<?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 Issues with AGOL replica removal using REST API and Python in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/issues-with-agol-replica-removal-using-rest-api/m-p/588449#M29543</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone. Not quite where the home for this post should be, but I'll start in the AGOL group as you have all proven to be a very smart bunch of people in the past.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm currently banging my head against a brick wall trying to work out a programmatic way to list and then subsequently unregister replicas on an AGOL feature service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I've got in place at the moment:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 - using&amp;nbsp;&lt;A class="link-titled" href="https://www.arcgis.com/sharing/rest/oauth2/token/" title="https://www.arcgis.com/sharing/rest/oauth2/token/"&gt;https://www.arcgis.com/sharing/rest/oauth2/token/&lt;/A&gt;&amp;nbsp; to generate a token, with Client ID and Client Secret sourced from developers.arcgis.com&lt;/P&gt;&lt;P&gt;2 - using Python 'requests' library to pass a POST request to &lt;A href="http://feature_service_url/replicas"&gt;http://feature_service_url/replicas&lt;/A&gt;, with the token as payload and also f = pjson&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This method above doesn't fail, but returns an empty JSON as the result.&lt;/P&gt;&lt;P&gt;If, however, I substitute in a token generated from the URL when I am logged into &lt;A href="http://www.arcgis.com"&gt;www.arcgis.com&lt;/A&gt;&amp;nbsp;and view a feature service URL, a legitimate result will be returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I can't work out is why will no result be returned when I am using a token generated by Step 1 above. I have used this in numerous other applications to interact with feature services without issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone shed any light on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony Cheesman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 25 Mar 2018 00:57:24 GMT</pubDate>
    <dc:creator>AnthonyCheesman1</dc:creator>
    <dc:date>2018-03-25T00:57:24Z</dc:date>
    <item>
      <title>Issues with AGOL replica removal using REST API and Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/issues-with-agol-replica-removal-using-rest-api/m-p/588449#M29543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone. Not quite where the home for this post should be, but I'll start in the AGOL group as you have all proven to be a very smart bunch of people in the past.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm currently banging my head against a brick wall trying to work out a programmatic way to list and then subsequently unregister replicas on an AGOL feature service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I've got in place at the moment:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 - using&amp;nbsp;&lt;A class="link-titled" href="https://www.arcgis.com/sharing/rest/oauth2/token/" title="https://www.arcgis.com/sharing/rest/oauth2/token/"&gt;https://www.arcgis.com/sharing/rest/oauth2/token/&lt;/A&gt;&amp;nbsp; to generate a token, with Client ID and Client Secret sourced from developers.arcgis.com&lt;/P&gt;&lt;P&gt;2 - using Python 'requests' library to pass a POST request to &lt;A href="http://feature_service_url/replicas"&gt;http://feature_service_url/replicas&lt;/A&gt;, with the token as payload and also f = pjson&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This method above doesn't fail, but returns an empty JSON as the result.&lt;/P&gt;&lt;P&gt;If, however, I substitute in a token generated from the URL when I am logged into &lt;A href="http://www.arcgis.com"&gt;www.arcgis.com&lt;/A&gt;&amp;nbsp;and view a feature service URL, a legitimate result will be returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I can't work out is why will no result be returned when I am using a token generated by Step 1 above. I have used this in numerous other applications to interact with feature services without issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone shed any light on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony Cheesman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Mar 2018 00:57:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/issues-with-agol-replica-removal-using-rest-api/m-p/588449#M29543</guid>
      <dc:creator>AnthonyCheesman1</dc:creator>
      <dc:date>2018-03-25T00:57:24Z</dc:date>
    </item>
  </channel>
</rss>

