- URL:
- https://<admin-root>/generateToken
- Methods:
GET- Required Capability:
- Administrator
- Version Introduced:
- 10.8
Description
Generates a token. The generated security token can be used by clients when working with the Administrator API.
Request Parameters
| Parameter | Description |
|---|---|
| The name of an administrative account for the site. Example |
| The credentials of the administrative account. Example |
| The client IP or HTTPS Referer to which the generated token will be bound. Values: |
| 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 |
(Optional, required if | The IP address of the machine that will invoke the Administrator API. Example |
| The time in minutes for which the token must be valid. Example |
| The response format. The default response format is Values: |
Example usage
Below is a sample POST request for generate :
POST /<context>/admin/generateToken HTTP/1.1
Host: organization.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
username=user1&password=testpassword&client=referer&referer=https://organization.example.com&expiration=90&f=jsonJSON Response syntax
{
"token":"<token>",
"expires": "<date>"
}JSON Response example
{
"token": "sakjfh97325437hskfsdfd_sdkjfsjf1283763339564921734sdfbdsj",
"expires": "13472658353687"
}