Zum Hauptinhalt springen

List all sessions

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

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

List of all sessions.

  • Array[
    • *object
      • createdstring (date-time)required
      • deviceobjectrequired
        • browserstring
        • modelstring
        • osstring
        • typestring
      • lastAccessstring (date-time)
      • locationobject
        • citystring
        • countrystring
        • ipAddressstring (ipv4)
      • tokenIdstring (uuid)required
    ]
Content-Type: application/json

[
{
"created": "1985-10-26T01:21:00.000Z",
"device": {
"browser": "Safari",
"model": "Apple Macintosh",
"os": "Mac OS",
"type": "Macbook"
},
"lastAccess": "1985-10-26T01:21:00.000Z",
"location": {
"city": "Espelkamp",
"country": "DE",
"ipAddress": "string"
},
"tokenId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
]
{
"items": {
"properties": {
"created": {
"format": "date-time",
"type": "string"
},
"device": {
"properties": {
"browser": {
"example": "Safari",
"type": "string"
},
"model": {
"example": "Apple Macintosh",
"type": "string"
},
"os": {
"example": "Mac OS",
"type": "string"
},
"type": {
"example": "Macbook",
"type": "string"
}
},
"type": "object"
},
"lastAccess": {
"format": "date-time",
"type": "string"
},
"location": {
"properties": {
"city": {
"example": "Espelkamp",
"type": "string"
},
"country": {
"example": "DE",
"type": "string"
},
"ipAddress": {
"format": "ipv4",
"type": "string"
}
},
"type": "object"
},
"tokenId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"device",
"created",
"tokenId"
],
"type": "object"
},
"type": "array"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/users/self/sessions?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.listSessions({
"queryParameters": {
"limit": 50,
"page": 1
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\ListSessions\ListSessionsRequest;

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

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

var_dump($response->getBody();

Auf dieser Seite