Generate Token

Description

Generates a token.

The generated security token can be used by clients when working with the Administrator API.

Parameters

Parameter

Description

username

The name of an administrative account for the site.

password

The credentials of the administrative account.

client

The client IP or HTTP Referer to which the generated token will be bound.

Values: referer | ip | requestip

  • If the value is referer, the referer parameter must be specified.
  • If the value is ip, the ip parameter must be specified.
  • If the value is requestip, the IP address from where the request originated is used.
referer

The base URL of the web application that will invoke the Administrator API. This parameter must be specified if the value of client parameter is referer.

Example: referer=http://myserver/mywebapp

ip

The IP address of the machine that will invoke the Administrator API. This parameter must be specified if the value of the client parameter is ip.

Example: ##.##.###.###

expiration

The time in minutes for which the token must be valid.

f

The response format. The default response format is html.

Values: html | json

Request Format

http://server:port/arcgis/admin/generateToken
	username=admin
	password=secret
	client=referer
	referer=http://myserver/mywebapp
	expiration=100

Response Format

{
	"token":"<token>",
	"expires": "<date>";
}

Example

{
	"token": "sakjfh97325437hskfsdfd_sdkjfsjf1283763339564921734sdfbdsj",
	"expires": "13472658353687"
}

7/5/2017