Tokens API v1 - GET token metadata
This API is deprecated. Use the Access tokens API instead.
Lists metadata of a Dynatrace API authentication token by the ID of the token. The token itself is not exposed.
Alternatively, you can retrieve metadata by submitting the token itself with the POST token metadata call.
The request produces an application/json
payload.
GET | SaaS | https://{your-environment-id}.live.dynatrace.com/api/v1/tokens/{id} |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v1/tokens/{id} |
Authentication
To execute this request, you need an access token with TenantTokenManagement
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
id | string | The ID of the required token. | path | required |
Response
Response codes
Code | Type | Description |
---|---|---|
200 | Token | Success |
404 | Error | Failed. The requested token has not been found. |
4XX | Error | Client side error. |
5XX | Error | Server side error. |
Response body objects
The TokenMetadata
object
Metadata of a token.
Element | Type | Description |
---|---|---|
created | integer | The creation time as a unix timestamp in milliseconds. |
expires | integer | The expiration time as a unix timestamp in milliseconds. |
id | string | The ID of the token. |
lastUse | integer | The unix timestamp in milliseconds when the token was last used. |
name | string | The name of the token. |
personalAccessToken | boolean | The token is a personal access token ( |
revoked | boolean | Revocation status of the token. Revoked tokens are disabled. |
scopes | string[] | A list of scopes assigned to the token.
|
userId | string | The owner of the token. |
Response body JSON model
{"created": 1554076800000,"expires": 1585976400000,"id": "acbed0c4-4ef1-4303-991f-102510a69322","lastUse": 1554354000000,"name": "myToken","personalAccessToken": true,"revoked": true,"scopes": ["DataExport","ReadConfig","WriteConfig"],"userId": "john.smith"}
Example
In this example, the request queries the metadata of the admin token, which has the ID of d5836312-5790-4e80-afcf-09971954c3ea.
The API token is passed in the Authorization header.
The token, as displayed in the Dynatrace interface, has the following settings:
Curl
curl -X GET \https://mySampleEnv.live.dynatrace.com/api/v1/tokens/d5836312-5790-4e80-afcf-09971954c3ea \-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'
Request URL
https://mySampleEnv.live.dynatrace.com/api/v1/tokens/d5836312-5790-4e80-afcf-09971954c3ea
Response body
{"id": "d5836312-5790-4e80-afcf-09971954c3ea","name": "admin","userId": "admin@mysampleenv.com","created": "2019-03-13T09:45:40Z","lastUse": "2019-04-04T09:13:23Z","scopes": ["ExternalSyntheticIntegration","DataPrivacy","WriteConfig","DssFileManagement","LogExport","DTAQLAccess","ReadConfig","CaptureRequestData","ReadSyntheticData","DataExport","UserSessionAnonymization","MaintenanceWindows","LogImport","TenantTokenManagement"]}
Response code
200