FRAMES | NO FRAMES Description | Parameters | Response
Generate Admin Token (Operation)
URL http://<admin-url>/generateToken

Note: From 10.1 onwards, the generateToken operation will not be supported by the REST API admin.

Use the generateToken operation supported by the ArcGIS Server's Admin API.

Description

The generate admin token operation. This operation generates a security token that can be used by clients when working with the Admin API. The ArcGIS Server Administrator is secured so that only users that have ADMINISTER or PUBLISH privileges have permissions to access the admin.

The token generated by this operation needs to be specified using the token parameter when accessing the Admin. Example:

http://<admin-url>/system/handlers/rest/cache/clear?token=<token>

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
username Description: The admin username. This user must be a member of the ArcGIS Server administrators group.
password Description: The admin password
client Description: The client IP or HTTP Referer for which the token is to be generated.
  • If the value is specified as ip, the ip parameter must be specified.
  • If the value is specified as requestip (request IP), the token is generated for the IP from where the request originated.
  • If the value is specified as referer, the referer parameter must be specified.
The default value is referer

Values: referer | ip | requestip
referer Description: The base url of the webapp that will invoke the Admin API. This parameter must be specified if the value of the client parameter is referer

Example: referer=http://myserver/mywebapp
ip Description: The ip address of the machine that will invoke the Admin API. This parameter must be specified if the value of the client parameter is ip

Example: ip=###.###.###.###
expiration Description: The token expiration time in minutes. The default is 60 minutes. Tokens can be generated upto a maximum expiry of 1 year (525600 minutes).

Example: expiration=43200 (1 month)

JSON Response Syntax

{
  "token": "<token>",
  "expires": <expires> //the time (in milliseconds from epoch) when this token will expire
}

JSON Response Example

{
  "token": "G6943LMReKj_kqdAVrAiPbpRloAfE1fqp0eVAJ-IChQcV-kv3gW-gBAzWztBEdFY",
  "expires": 1255466350163
}