Zum Hauptinhalt springen

List all of your ApiTokens

GET/v2/users/self/api-tokens
API-Version
v2
Request-Methode
GET
Operation-ID
user-list-api-tokens

Request​

Responses​

Response-Header
  • X-Pagination-Limitinteger

    The limit used to select the resources for the response

  • X-Pagination-Skipinteger

    The number of skipped items

  • X-Pagination-Pagenumber

    The calculate page of the list response. Refer to parameters to learn more.

  • X-Pagination-TotalCountinteger

    The total amount of items available in the remote ressource. Use this value in combination with the limit to calculate the available pages.

Format
application/json
Beschreibung

A list of ApiTokens.

  • Array[
    • *object
      • apiTokenIdstring (uuid)required
      • createdAtstring (date-time)required
      • descriptionstringrequired
      • expiresAtstring (date-time)
      • rolesArray von string (einer von: api_read, api_write)required
        • Array[
          • *string (einer von: api_read, api_write)
          ]
    ]
Content-Type: application/json

[
{
"apiTokenId": "f0f86186-0a5a-45b2-aa33-502777496347",
"createdAt": "1985-10-26T01:21:00.000Z",
"description": "Api Token - read",
"expiresAt": "1985-10-26T01:21:00.000Z",
"roles": [
"api_read"
]
}
]
{
"items": {
"properties": {
"apiTokenId": {
"format": "uuid",
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"description": {
"example": "Api Token - read",
"type": "string"
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"roles": {
"items": {
"enum": [
"api_read",
"api_write"
],
"type": "string"
},
"type": "array"
}
},
"required": [
"apiTokenId",
"roles",
"description",
"createdAt"
],
"type": "object"
},
"type": "array"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/users/self/api-tokens?limit=50&page=1
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.user.listApiTokens({
"queryParameters": {
"limit": 50,
"page": 1
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\ListApiTokens\ListApiTokensRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new ListApiTokensRequest())
->withLimit(50)
->withPage(1);
$response = $client->user()->listApiTokens($request);

var_dump($response->getBody();

Auf dieser Seite