Appearance
Generate a token
About 301 wordsAbout 1 min
apiAuthenticationToken
2026-04-27
MethodPOST
Request URL
/plugin/datafor-modeler/api/token/generateAuthorization
Use of this API requires authentication. For details about the authentication method, see
Authorization.
Content Typeapplication/json
Preconditions
- The current user's user type must be
Administrator.
Parameters
name: ERP
privateKey: abcd
payload:
username: admin
name: ERP
roles:
- SYS_CREATOR
- Manager
inituser: string
password: string
company: string
dept: string
email: string
description: string
title: string
dob: string
mobile: string| Name | Location | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | yes | The main data object for generating the token. |
| ├── name | body | string | yes | Name of the token. |
| ├── privateKey | body | string | yes | Private key associated with the token. |
| ├── payload | body | object | yes | The payload object containing user and role info. |
| ├── username | body | string | yes | Username for token generation. |
| ├── name | body | string | no | User's name. |
| ├── roles | body | array(string) | no | List of user roles. |
| ├── inituser | body | string | no | Initial user. |
| ├── password | body | string | no | User password. |
| ├── company | body | string | no | Company name. |
| ├── dept | body | string | no | Department name. |
| body | string | no | Email address. | |
| ├── description | body | string | no | Description. |
| ├── title | body | string | no | Title. |
| ├── dob | body | string | no | Date of birth. |
| └── mobile | body | string | no | Mobile number. |
Response Examples
{
"success": true,
"expire": 86400,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJFUlAiOiJhZG1pbiIsImV4cCI6MTcyMzAxNTkxNn0.uEmUwBfNAd5FtzjPPrldU9bierng7fd8rCVlZtVPY2k"
}HTTP Responses
| HTTP Status Code | Meaning | Description | Data schema |
|---|---|---|---|
| 200 | OK | The request was successful. | Inline |
Response Data Schema (HTTP 200)
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
success | boolean | Yes | none | Indicates if the token generation was successful (true or false). |
expire | integer | Yes | none | The token's expiration time in seconds. |
token | string | Yes | none | The generated token string. |