Tokens API - POST token lookup
Lists metadata of a DESK API authentication token by the token itself.
Alternatively, you can retrieve metadata by submitting the ID of the token with the GET token metadata call.
The request consumes and produces an application/json
payload.
POST |
|
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | Token |
The JSON body of the request. Contains the required token. |
body | required |
The Token object
Element | Type | Description | Required |
---|---|---|---|
token | string |
DESK API authentication token. |
required |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request. See the Example expandable section for working sample request.
{
"token": "abcdefjhij1234567890"
}
Response format
The TokenMetadata object
Metadata of a token.
Element | Type | Description |
---|---|---|
id | string | The ID of the token. |
name | string | The name of the token. |
userId | string | The owner of the token. |
revoked | boolean | Revocation status of the token. Revoked tokens are disabled. |
created | integer | The creation time as a unix timestamp in milliseconds. |
expires | integer | The expiration time as a unix timestamp in milliseconds. |
lastUse | integer | The unix timestamp in milliseconds when the token was last used. |
scopes | string[] | The list of permissions, assigned to the token. |
{
"id": "acbed0c4-4ef1-4303-991f-102510a69322",
"label": "myToken",
"userId": "john.smith",
"revoked": "true",
"created": "1554076800000",
"expires": "1585976400000",
"lastUse": "1554354000000",
"scopes": [
"DataExport",
"ReadConfig",
"WriteConfig"
]
}
Example
In this example, the request queries the metadata of the abcdefjhij1234567890 token.
The API token is passed in the Authorization header.
The token, as displayed in the DESK interface, has the following settings:
Curl
curl -X POST \
https://mySampleEnv.live.dexp.ae/api/v1/tokens/lookup \
-H 'Authorization: Api-Token abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
-d '{
"token": "abcdefjhij1234567890"
}'
Request URL
https://mySampleEnv.live.dexp.ae/api/v1/tokens/lookup
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