API tokens schema
service.token.graphqls
To authenticate API requests, you’ll need an API token. Learn how to generate an access token.
See usage examples in the cloudbeaver-graphql-examples repository.
You can try queries in the built-in GraphQL console, available on your server at https://your-server-address/api/gql/console. This tool lets you test requests directly from your browser.
For a live example, see the demo GraphQL console.
API Endpoints
https://your-server-address/api/gql
Queries
tokenApiList
Description
Returns list of user API tokens
Response
Returns [APITokenInfo!]!
Example
Query
query tokenApiList {
tokenApiList {
tokenName
createTime
expireTime
createTimeAt
expireTimeAt
}
}
Response
{
"data": {
"tokenApiList": [
{
"tokenName": "<string>",
"createTime": "<date>",
"expireTime": "<date>",
"createTimeAt": "<datetime>",
"expireTimeAt": "<datetime>"
}
]
}
}
Mutations
tokenApiCreate
Description
Creates API token for user. You can specify token name and expiration time.
Response
Returns an APIFullTokenInfo!
Example
Query
mutation tokenApiCreate(
$tokenName: String!,
$expiresAt: DateTime
) {
tokenApiCreate(
tokenName: $tokenName,
expiresAt: $expiresAt
) {
tokenName
token
createTime
expireTime
createTimeAt
expireTimeAt
}
}
Variables
{"tokenName": "<string>", "expiresAt": "<datetime>"}
Response
{
"data": {
"tokenApiCreate": {
"tokenName": "<string>",
"token": "<string>",
"createTime": "<date>",
"expireTime": "<date>",
"createTimeAt": "<datetime>",
"expireTimeAt": "<datetime>"
}
}
}
tokenApiDelete
Description
Deletes API token for user based on its name
Types
APIFullTokenInfo
Example
{
"tokenName": "<string>",
"token": "<string>",
"createTime": "<date>",
"expireTime": "<date>",
"createTimeAt": "<datetime>",
"expireTimeAt": "<datetime>"
}
APITokenInfo
Example
{
"tokenName": "<string>",
"createTime": "<date>",
"expireTime": "<date>",
"createTimeAt": "<datetime>",
"expireTimeAt": "<datetime>"
}
Boolean
Description
The Boolean scalar type represents true or false.
Example
"<boolean>"
Date
Example
"<date>"
DateTime
Description
Date/Time
Example
"<datetime>"
String
Description
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
Example
"<string>"