Get the Token
1. API Description
This API is used to get the user's Token.
Request mode: POST [ip]/api/user/token-all
| Administrator Rights | Logged-in |
|---|---|
| Yes | Yes |
2. Input Parameters
Null
3. Output Parameters
| Name | Type | Description |
|---|---|---|
| status | Int | Status code |
| code | String | Status description |
| tokens | Array of TokenInfo | Token list |
TokenInfo
| Name | Type | Description |
|---|---|---|
| username | string | The user name |
| token | string | Token |
| expire | int | Token expiration time, starting from 1970-01-01 00:00:00 +0000 (UTC), in seconds. -1 means unlimited. |
4. Example
Getting the user's Token.
Input Example
None
Output Example
{
"tokens": [
{
"username": "Admin",
"token": "HTrkbOUWh3KCl57aYmSLHT3qDyswncF4ynAGJatr8i5laiZZbUT83MnhRJOlghFB",
"expire": -1
}
],
"status": 0,
"code": "Success"
}
5. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Status | Definition | Description |
|---|---|---|
| 31 | NOT_PERMITTED | Only administrators have permission |