<?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: ArcGIS Online REST GET Request - Error Code 498 in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-online-rest-get-request-error-code-498/m-p/1017761#M3698</link>
    <description>&lt;P&gt;I am having the same issue. I am generating the access token using&amp;nbsp;generateToken REST API via POST. And then trying to access the secure folder using&amp;nbsp;&lt;A href="https://xxxxx/arcgis/rest/services/OSvC/?f=json&amp;amp;token=" target="_blank"&gt;https://xxxxx/arcgis/rest/services/OSvC/?f=json&amp;amp;token=&lt;/A&gt;. But getting 'Invalid Token' error. I can access the same folder through the browser by manually providing the credentials to the rest/login page.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jan 2021 21:15:15 GMT</pubDate>
    <dc:creator>anuragmittal</dc:creator>
    <dc:date>2021-01-18T21:15:15Z</dc:date>
    <item>
      <title>ArcGIS Online REST GET Request - Error Code 498</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-online-rest-get-request-error-code-498/m-p/1015443#M3675</link>
      <description>&lt;P&gt;I am trying to use the GenerateToken endpoint to generate a token for my AGOL user account, from which I can subsequently perform a GET request on a FeatureLayer that is hosted in AGOL and shared with my user account.&lt;/P&gt;&lt;P&gt;I'm successfully receiving a token from the following URL via POST request as indicated via docs&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/" target="_blank"&gt;https://www.arcgis.com/sharing/generateToken/?f=json&amp;amp;username=&amp;lt;MY_AGOL_USERNAME&amp;gt;&amp;amp;password=&amp;lt;MY_AGOL_PASSWORD&amp;gt;&amp;amp;client=requestip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I then try to perform a GET request for my FeatureLayer, using the URL below and passing through the token I received from the previous POST&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/" target="_blank"&gt;https://services1.arcgis.com/&amp;lt;HIDDEN&amp;gt;/arcgis/rest/services/&amp;lt;FEATURE_LAYER_NAME&amp;gt;/FeatureServer?f=json&amp;amp;token=&amp;lt;TOKEN_FROM_GENERATETOKEN&amp;gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Unfortunately the response is&amp;nbsp;&lt;STRONG&gt;{"error":{"code":498,"message":"Invalid token.","details":["Invalid token."]}}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I can confirm that I have permission to view the FeatureLayer, as I can log into AGOL via the same credentials and view the feature layer.&amp;nbsp; When I click view, AGOL generates it's own token and if I was to use that token via&amp;nbsp;&lt;/P&gt;&lt;P&gt;The expiry time of the token being returned is 2 hours from my current time.&lt;/P&gt;&lt;P&gt;Am I correct in assuming the token returned via /GenerateToken should enable me to perform GET requests on FeatureLayers/Services?&lt;/P&gt;&lt;P&gt;I'm not sure what else to try as there is minimal information in the error code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I cannot use the oAuth2 process here, hence using GenerateToken.&amp;nbsp; Reason why is I'm writing some python scripts to automate some processing of data, and I need to have user credentials hard coded into the scripts.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 07:02:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-online-rest-get-request-error-code-498/m-p/1015443#M3675</guid>
      <dc:creator>RyanVeenstraGHD</dc:creator>
      <dc:date>2021-01-11T07:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Online REST GET Request - Error Code 498</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-online-rest-get-request-error-code-498/m-p/1015484#M3676</link>
      <description>&lt;P&gt;what does your GET request look like / how are you sending the token?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 11:23:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-online-rest-get-request-error-code-498/m-p/1015484#M3676</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-01-11T11:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Online REST GET Request - Error Code 498</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-online-rest-get-request-error-code-498/m-p/1015755#M3678</link>
      <description>&lt;P&gt;I don't see in your request where you are including the token "...&amp;lt;featurelayer&amp;gt;/FeatureServer?f=json..."; but perhaps you are.&lt;/P&gt;&lt;P&gt;It looks like you might also be missing the layer id and the type of request.&amp;nbsp; Here's my suggestion for the format:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;https://services1.arcgis.com/&amp;lt;account info&amp;gt;/arcgis/rest/services/&amp;lt;feature layer name&amp;gt;/FeatureServer/&amp;lt;layerid&amp;gt;/query?where=&amp;amp;outFields=*&amp;amp;f=json&amp;amp;token=&amp;lt;token&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm also not sure if your token request is actually a post request as it looks like you may be appending your username and password to the url as in a get request.&amp;nbsp;&amp;nbsp; &lt;A title="Difference between GET and POST method in HTTP" href="https://www.tutorialspoint.com/listtutorial/Difference-between-GET-and-POST-method-in-HTTP/3916" target="_self"&gt;Difference between GET and POST method in HTTP&lt;/A&gt;&amp;nbsp;&amp;nbsp; I suggest you consider using only post requests for security.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 21:40:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-online-rest-get-request-error-code-498/m-p/1015755#M3678</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-01-11T21:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Online REST GET Request - Error Code 498</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-online-rest-get-request-error-code-498/m-p/1017761#M3698</link>
      <description>&lt;P&gt;I am having the same issue. I am generating the access token using&amp;nbsp;generateToken REST API via POST. And then trying to access the secure folder using&amp;nbsp;&lt;A href="https://xxxxx/arcgis/rest/services/OSvC/?f=json&amp;amp;token=" target="_blank"&gt;https://xxxxx/arcgis/rest/services/OSvC/?f=json&amp;amp;token=&lt;/A&gt;. But getting 'Invalid Token' error. I can access the same folder through the browser by manually providing the credentials to the rest/login page.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 21:15:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/arcgis-online-rest-get-request-error-code-498/m-p/1017761#M3698</guid>
      <dc:creator>anuragmittal</dc:creator>
      <dc:date>2021-01-18T21:15:15Z</dc:date>
    </item>
  </channel>
</rss>

