Skip to main content

Get a specific session

GET/v2/users/self/sessions/{tokenId}
API version
v2
Request method
GET
Operation ID
user-get-session

Request​

  • tokenIdstringrequired

    TokenId to identify a specific session.

Responses​

Format
application/json
Description

The session.

  • 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"
}
{
"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"
}

Usage examples​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/users/self/sessions/string
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.getSession({
"tokenId": "string"
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\GetSession\GetSessionRequest;

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

$request = (new GetSessionRequest(
tokenId: "string"
));
$response = $client->user()->getSession($request);

var_dump($response->getBody();

On this page