URL:
https://<root>/generateToken
Methods:
POST
Version Introduced:
12.1

Description

The generateToken operation generates a token that can be used by clients when working with the ArcGIS Velocity Administrator API.

Request parameters

ParameterDetails

username

(Required)

The Primary Site Administrator (PSA) account username.

Example:

Use dark colors for code blocksCopy
1
username=velocityPsaAccount

password

(Required)

The Primary Site Administrator (PSA) account password.

Example:

Use dark colors for code blocksCopy
1
password=test1234

client

(Optional)

The client identification type for which the token is to be generated. Users can specify whether the token will be generated for a client application's base URL, a user-specified IP address, or the IP address that is making the request.

Values: referer | ip | requestip

referer

(Optional)

(Required if client is set to referer)

The base URL of the web app that will invoke the request to access a secured resource. This parameter must be specified if the value of the client parameter is referer.

Example:

Use dark colors for code blocksCopy
1
referer=https://myserver/mywebapp

ip

(Optional)

(Required if client is set to ip)

The IP address of the machine that will invoke the request to access a secured resource. This parameter must be specified if the value of the client parameter is ip.

Example:

Use dark colors for code blocksCopy
1
ip=###.###.###.###

expiration

The token expiration time in minutes. The default is 60 minutes (one hour). The maximum value of the expiration time is controlled by the server. Requests for an expiration time greater than this maximum will return a token with the maximum allowed expiration time. Applications are responsible for renewing expired tokens; the server rejects expired tokens on subsequent requests.

Example:

Use dark colors for code blocksCopy
1
expiration=60

f

(Optional)

The response format. The default response format is html.

Values: html | json | pjson

Example usage

The following is a sample POST request for the generateToken operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /<context>/admin/generateToken HTTP/1.1
Host: organization.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

username=velocityPsaAccount&password=test1234&client=referer&referer=https://organization.example.com&expiration=60&f=pjson

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
{
  "expires": 1785527948400,
  "loginAsPSA": true,
  "token": "fBLBp14_l2KnJc9QHGagjar85njaDryK2QX7Pzeuu-1dFHcyOK9FG yWR3S4_4FmcgCrd7o31uJZXOnu5oC0RG9kae65KX2KSZcjk0nfaxxEUML6d_rji8Ybyu6ISxBbwbXSkF5jIIDyKeciGy-tI9d4ga74rOdJ7ZrTJZTzqA."

}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.