Generate a Token

2078
2
03-16-2019 09:31 AM
KellyGerrow
Esri Frequent Contributor
1 2 2,078

In order to access the history log, an administrator token must be appended to your request. You can obtain a token in a few ways. The following log includes two quick ways to grab this token. 

Note. As these are administrative tokens, please don't share your token in the forums. These can potentially be used in malicious ways if the wrong person obtains your token. 

Option 1: Generate a token using postman

1. Download or open postman  (It's free)

2. Click the +New button to create a new request

3. In the new tab, set the following:

  • Change the HTTP method from GET to POST.
  • Set the URL to https://www.arcgis.com/sharing/generateToken

4. Click on Body and add the following parameters as Key/Value pairs:

  • username: Your administrator username (case sensitive)
  • password: Your password
  • referer https://www.arcgis.com
  •   f : json

5. Click Send and copy the token in the response below for use in requests

Option 2: Use Developer tools

1. Open developer tools in your browser  ( In chrome, Menu>more tools> Developer tools)

2. Sign into arcgis.com with your administrator credentials

3.  In the developer tools click on network and type 'self' into the filter box

4. Click on the first url, click header tab and scroll to Query String Parameters(the very last section).

5. Copy the token value to use in requests

2 Comments
SandeepMidgule1
New Contributor

Hi Kelly Gerrow‌,

Just want to ask one question. I have successfully created token from Postman. Now to access my hosted services on AGOL, I append reponse token to Feature Service like

https://services1.arcgis.com/Bx7Lx85n4mZ898Vi/arcgis/rest/services/<xyz>/FeatureServer/1?token=<response_token>, I am getting 'Invalid Token' error. I tried using POSTMAN also, but no luck.

FPCWAGIS_Admin
New Contributor III

@Kelly Gerrow, thanks. Quite helpful. What if I have a feature service and want to generate token for other to access say in third party APIs. AZURE for instance

Labels