AnsweredAssumed Answered

Using tokens in arcgis rest api queries

Question asked by ahmadabusaleh on Aug 7, 2018
Latest reply on Aug 9, 2018 by ahmadabusaleh

Hello,

I have a web page that takes a query then submits it the the ArcGIS server rest end point,

http://myserver/arcgis/rest/services/myService/MapServer/0/query 

 

the web page looks like the following image and I sucessfully pass the parameters and receive  the results. 

 

My issue is that I am reading from a secured service and every time I hit the button "Get the Map" it asks me to login   the arcgis server. 

I know that I can use a token to get the results, but unfortunately I couldn't figure out how to include it in the submit button.  

 <form name="sdform2" 

action="http://MyServer:6080/arcgis/rest/services/MyService/MapServer/1/query"

method="post">



<tr valign="top">
<p hidden>
<td>Where:</td>
<td>
<input type="text" Name="where" Id=whereNodes value="NID=&#39;test&#39;" size="45">
</p>
<br>
<br>
<table border=".1">
<tr align="center">
<td width="120">Title</td>



<td>
<p hidden>
<input type="text" id="outNodeFields" name="outFields" value="*" size="75">
<select name="f">
<option value="kmz">KMZ</option>
<option value="json">json</option>
</select>
</p>
</td>

<td>

<input type="submit" value="Submit">
</td>
</tr>
</table>
</form>

Any help is highly appreciated. 

 

Thank you,

Ahmad

Outcomes