Skip to main content

GenerateToken

Generate a personal token that can later be assigned to a user.

Requires a valid session, with no additional permissions. No input or output blobs are used.

Parameters​

This command takes an empty object.

Behavior​

The generated token grants no access until an administrator assigns it using UpdateUser. Keep the full value securely; inspection later returns only its first 13 characters as a tag. Personal tokens remain usable until removed from their user or the user is deleted.

Response​

Success returns status: 0 and token, a new value with the adbp_ prefix. Failures return a negative status and an info message; see Responses for error envelopes and retry guidance.

Examples​

Generate a personal token:

[{
"GenerateToken": {
}
}]

Response:

[{
"GenerateToken": {
"status": 0,
"token": "adbp_TxchBKOyerwLEbNnnhuoxtzSuC8ag0u9j5O"
}
}]

Assign it to an existing user:

[{
"UpdateUser": {
"username": "john",
"add_tokens": ["adbp_TxchBKOyerwLEbNnnhuoxtzSuC8ag0u9j5O"]
}
}]

Response:

[{
"UpdateUser": {
"status": 0
}
}]

Revoke the personal token:

[{
"UpdateUser": {
"username": "john",
"remove_tokens": ["adbp_TxchBKOyerwLEbNnnhuoxtzSuC8ag0u9j5O"]
}
}]

Response:

[{
"UpdateUser": {
"status": 0
}
}]