Tokens API - GET all tokens
Lists all DESK API authentication tokens of your environment. The list contains only the names and IDs of tokens. You can retrieve details either by the ID of the token or by the token itself.
The request produces an application/json
payload.
GET |
|
Response format
The StubList object
An ordered list of short representations of DESK entities.
Element | Type | Description |
---|---|---|
values | EntityShortRepresentation[] | An ordered list of short representations of DESK entities. |
The EntityShortRepresentation object
The short representation of a DESK entity.
Element | Type | Description |
---|---|---|
id | string | The ID of the DESK entity. |
name | string | The name of the DESK entity. |
description | string | A short description of the DESK entity. |
{
"values": [
{
"id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a",
"name": "DESK entity 1",
"description": "DESK entity 1 for the REST API example\n"
},
{
"id": "ee70f7d3-9a4e-4f5f-94d2-c9d6156f1618",
"name": "DESK entity 2"
},
{
"id": "8cdabe77-9e1a-4be8-b3df-269dd6fa9d7f"
}
]
}
Example
In this example, the request lists all API tokens of the mySampleEnv
environment.
The API token is passed in the Authorization header.
The result is truncated to three entries.
Curl
curl -X GET \
https://mySampleEnv.live.dexp.ae/api/v1/tokens \
-H 'Authorization: Api-Token abcdefjhij1234567890'
Request URL
https://mySampleEnv.live.dexp.ae/api/v1/tokens
Response body
{
"values": [
{
"id": "d5836312-5790-4e80-afcf-09971954c3ea",
"name": "admin"
},
{
"id": "ab42e02c-fbbe-413c-b225-9a87d5efbd60",
"name": "dev token"
},
{
"id": "434d9b21-1e38-4be3-8b90-5a76d531ca53",
"name": "devops"
}
]
}
Response code
200