Skip to main content

Check status of the current session

GET/v2/users/self/sessions/current/status
API version
v2
Request method
GET
Operation ID
user-get-current-session-status

Request​

No request parameters.

Responses​

Format
application/json
Description

Status of the current session.

  • isEmployeebooleanrequired

    Whether the executing user is an employee.

  • isImpersonatedbooleanrequired

    Whether the current session is an impersonation.

  • tokenIdstring (uuid)required

    The ID of the token currently in use.

  • userIdstring (uuid)required

    ID of the executing user.

Content-Type: application/json

{
"isEmployee": true,
"isImpersonated": true,
"tokenId": "f0f86186-0a5a-45b2-aa33-502777496347",
"userId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
{
"properties": {
"isEmployee": {
"description": "Whether the executing user is an employee.",
"type": "boolean"
},
"isImpersonated": {
"description": "Whether the current session is an impersonation.",
"type": "boolean"
},
"tokenId": {
"description": "The ID of the token currently in use.",
"format": "uuid",
"type": "string"
},
"userId": {
"description": "ID of the executing user.",
"format": "uuid",
"type": "string"
}
},
"required": [
"userId",
"tokenId",
"isImpersonated",
"isEmployee"
],
"type": "object"
}

Usage examples​

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

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\GetCurrentSessionStatus\GetCurrentSessionStatusRequest;

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

$request = (new GetCurrentSessionStatusRequest());
$response = $client->user()->getCurrentSessionStatus($request);

var_dump($response->getBody();

On this page