I generated a token by following the process mentioned in the developer documentation, using dummy URLs to check the APIs in Postman. However, when I try to make a GET request, it shows an invalid token. Can someone please help me on this or identify where I made mistake ?
Solved! Go to Solution.
Hey @UJJWALSINGH
I typically use this function here in Python to generate the token:
def GetToken(username, password):
url = f'https://www.arcgis.com/sharing/generateToken?f=json&username={username}&password={password}&referer=http://www.arcgis.com'
json = requests.get(url+'&f=json').json()
return json['token']
Once the token is returned, this is how I enter it into Postman to use for testing purposes:
Postman will need to take the token as a Bearer Token, once that is input, everything should work fine!
If that doesn't end up working, let me know and I'll see what I can find!
Cody
Hey @UJJWALSINGH
I typically use this function here in Python to generate the token:
def GetToken(username, password):
url = f'https://www.arcgis.com/sharing/generateToken?f=json&username={username}&password={password}&referer=http://www.arcgis.com'
json = requests.get(url+'&f=json').json()
return json['token']
Once the token is returned, this is how I enter it into Postman to use for testing purposes:
Postman will need to take the token as a Bearer Token, once that is input, everything should work fine!
If that doesn't end up working, let me know and I'll see what I can find!
Cody
Thank you! this is working