from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
api_token = client.iam.api_tokens.get(
token_id=0,
client_id=0,
)
print(api_token.id)
{
"name": "My token",
"description": "It's my token",
"exp_date": "2021-01-01 12:00:00+00:00",
"client_user": {
"role": {
"id": 1,
"name": "Administrators"
},
"deleted": false,
"user_id": 123,
"user_name": "John Doe",
"user_email": "some@email.com",
"client_id": 456
},
"id": 42,
"deleted": false,
"expired": false,
"created": "2021-01-01 12:00:00+00:00",
"last_usage": "2021-01-01 12:00:00+00:00"
}
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
api_token = client.iam.api_tokens.get(
token_id=0,
client_id=0,
)
print(api_token.id)
{
"name": "My token",
"description": "It's my token",
"exp_date": "2021-01-01 12:00:00+00:00",
"client_user": {
"role": {
"id": 1,
"name": "Administrators"
},
"deleted": false,
"user_id": 123,
"user_name": "John Doe",
"user_email": "some@email.com",
"client_id": 456
},
"id": 42,
"deleted": false,
"expired": false,
"created": "2021-01-01 12:00:00+00:00",
"last_usage": "2021-01-01 12:00:00+00:00"
}
API key for authentication. Make sure to include the word apikey
, followed by a single space and then your token.
Example: apikey 1234$abcdef
OK.
The response is of type object
.
Was this page helpful?