Question

Has anyone successfully obtained a token from ArcGIS Server (10.9) using HTTP Caller?

  • 9 January 2023
  • 3 replies
  • 46 views

Badge

Trying to automate some ArcGIS Server monitoring and am struggling to get a token using HTTP Caller. I think there may be a bug on the ESRI end (surprise!). But before I post on their forum, I wanted to pin the FME world.

 

I'm making a POST to here:

myserver.domain:6443/arcgis/admin/generateToken

which is the same place I go for manually obtaining a token. As query parameters I have:

client : requestip
f : json

 as Headers:

Content-type : application/x-www-form-urlencoded
 Accept : text/plain

I have tried both putting username/password in Body and Query. Neither works. If I grab a token manually and pass it in the HTTP Caller as parameter, I have no trouble making a connection to the same URL.

 

Has anyone gotten this to work, or has a clue where I'm going off course? Thanks


3 replies

Userlevel 3
Badge +17

Hello @agelfert​ 

I was able to obtain a token from an ArcGIS Server instance using the following settings in the HTTPCaller:

HTTPCaller settings to obtain token from ArcGIS ServerI specified the required request parameters (username, password, client, f, etc.) in the Upload Body and set the body Content Type as 'URL Encoded'. The format of request parameter is <requestKey>=<requestValue> (eg. username=test123) with an & symbol delimiting each request parameter. I did not have to use additional query strings or headers. I hope this information helps.

Upload Body format to obtain token from ArcGIS Server

Badge

Just learned that if I use this:

Content-type : application/x-www-form-urlencoded

all parameters need to go in the body. I still had 'client' and 'f ' in the query. Good to know.

Related thread.

https://community.esri.com/t5/arcgis-enterprise-questions/obtaining-arcgis-server-token-programmatically/td-p/1246547/jump-to/first-unread-message

Badge

Hello @agelfert​ 

I was able to obtain a token from an ArcGIS Server instance using the following settings in the HTTPCaller:

HTTPCaller settings to obtain token from ArcGIS ServerI specified the required request parameters (username, password, client, f, etc.) in the Upload Body and set the body Content Type as 'URL Encoded'. The format of request parameter is <requestKey>=<requestValue> (eg. username=test123) with an & symbol delimiting each request parameter. I did not have to use additional query strings or headers. I hope this information helps.

Upload Body format to obtain token from ArcGIS Server

Thanks, @debbiatsafe​  I will check it out. My premature exuberance yesterday quickly evaporated when i realized I was no longer getting an error but still not getting my token. Haha.

Reply