<?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 Generate token to query AGOL History API without using ArcGIS Python API in ArcGIS REST JS Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-js-questions/generate-token-to-query-agol-history-api-without/m-p/1230406#M16</link>
    <description>&lt;P&gt;I would like to query my AGOL organization's History API (&lt;A href="https://myorg.maps.arcgis.com/sharing/rest/portals/self/history" target="_blank"&gt;https://myorg.maps.arcgis.com/sharing/rest/portals/self/history&lt;/A&gt;) without using the ArcGIS Python API, just using Python requests library.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My understanding is I would need to generate an admin token, and use that token to query the API.&amp;nbsp; However, I cannot figure out how to generate a token for this workflow.&amp;nbsp;&lt;/P&gt;&lt;P&gt;res=requests.post("&lt;A href="https://myorg.maps.arcgis.com/sharing/rest/generateToken" target="_blank"&gt;https://myorg.maps.arcgis.com/sharing/rest/generateToken&lt;/A&gt;",params=params) returns the error:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;["POST request should not contain username and password in the query string."]&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;Can someone please point me to a clear explanation of how to implement this process?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2022 13:25:43 GMT</pubDate>
    <dc:creator>Jay_Gregory</dc:creator>
    <dc:date>2022-11-10T13:25:43Z</dc:date>
    <item>
      <title>Generate token to query AGOL History API without using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-rest-js-questions/generate-token-to-query-agol-history-api-without/m-p/1230406#M16</link>
      <description>&lt;P&gt;I would like to query my AGOL organization's History API (&lt;A href="https://myorg.maps.arcgis.com/sharing/rest/portals/self/history" target="_blank"&gt;https://myorg.maps.arcgis.com/sharing/rest/portals/self/history&lt;/A&gt;) without using the ArcGIS Python API, just using Python requests library.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My understanding is I would need to generate an admin token, and use that token to query the API.&amp;nbsp; However, I cannot figure out how to generate a token for this workflow.&amp;nbsp;&lt;/P&gt;&lt;P&gt;res=requests.post("&lt;A href="https://myorg.maps.arcgis.com/sharing/rest/generateToken" target="_blank"&gt;https://myorg.maps.arcgis.com/sharing/rest/generateToken&lt;/A&gt;",params=params) returns the error:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;["POST request should not contain username and password in the query string."]&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;Can someone please point me to a clear explanation of how to implement this process?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 13:25:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-js-questions/generate-token-to-query-agol-history-api-without/m-p/1230406#M16</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2022-11-10T13:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Generate token to query AGOL History API without using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-rest-js-questions/generate-token-to-query-agol-history-api-without/m-p/1230712#M17</link>
      <description>&lt;P&gt;Can you try it with this Postman REST request?&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.postman.com/arcgis-developer/workspace/arcgis-location-services/request/15786767-e94a9e88-44f6-4382-82f0-511fa876cbfe" target="_blank"&gt;https://www.postman.com/arcgis-developer/workspace/arcgis-location-services/request/15786767-e94a9e88-44f6-4382-82f0-511fa876cbfe&lt;/A&gt;&lt;/P&gt;&lt;P&gt;See if it works there or you get a similar error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 21:06:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-js-questions/generate-token-to-query-agol-history-api-without/m-p/1230712#M17</guid>
      <dc:creator>John-Foster</dc:creator>
      <dc:date>2022-11-10T21:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Generate token to query AGOL History API without using ArcGIS Python API</title>
      <link>https://community.esri.com/t5/arcgis-rest-js-questions/generate-token-to-query-agol-history-api-without/m-p/1230722#M18</link>
      <description>&lt;P&gt;Ah okay.&amp;nbsp; Worked in postman.&amp;nbsp; If I change my Python line from&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;res=requests.post("&lt;/SPAN&gt;&lt;A href="https://myorg.maps.arcgis.com/sharing/rest/generateToken" target="_blank" rel="nofollow noopener noreferrer"&gt;https://myorg.maps.arcgis.com/sharing/rest/generateToken&lt;/A&gt;&lt;SPAN&gt;",params=params) to&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;res=requests.post("&lt;A href="https://myorg.maps.arcgis.com/sharing/rest/generateToken" target="_blank" rel="nofollow noopener noreferrer"&gt;https://myorg.maps.arcgis.com/sharing/rest/generateToken&lt;/A&gt;",data=params)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it works.&amp;nbsp; Got that from&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/26615756/python-requests-module-sends-json-string-instead-of-x-www-form-urlencoded-param" target="_blank"&gt;https://stackoverflow.com/questions/26615756/python-requests-module-sends-json-string-instead-of-x-www-form-urlencoded-param&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 21:30:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-js-questions/generate-token-to-query-agol-history-api-without/m-p/1230722#M18</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2022-11-10T21:30:04Z</dc:date>
    </item>
  </channel>
</rss>

