πŸ”Sessions

This page provides a description of the available API routes for managing sessions.

After a user is authenticated, a session is created. For all subsequent requests to the API, specific rules based on the user's authentication scheme must be applied. If the session resource is deleted, the user will no longer be able to use the token issued in the last authentication and will need to log in again. The session is represented by the Session class.

API methods

Get sessions

GET http://{server-address}/sessions

Returns all sessions that matches query parameters. Result is of type QueryResult<Session>.

Query Parameters

NameTypeDescription

sessionId

string

Supports NData syntax.

$skip

int

Pagination property. Describing number of records to skip from beginning of result collection.

$take

int

Pagination property. Maximum count of items to be returned.

$sort

string[]

Comma separated list of property names. Please see NData syntax.

$count

bool

If set to true, response will not contain items collection. Use to get resource count, not the resources themselves.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "items": [
        {
            "sessionId": "soZIt6uj62fzs8ep4UvnNSxRXFryUiq3",
            "identity": {
                "userName": "999",
                "deviceName": "P01",
                "envName": "CashRegister",
                "authenticationType": "Bearer"
            },
            "startedAt": "2023-08-04T11:19:38.015Z",
            "expiresAt": "2023-08-04T23:19:38.015Z",
            "lastAccessAt": "2023-08-04T11:19:39.98Z",
            "_v": 2
        },
        {
            "sessionId": "Hq6563mjODIOwNa87Cgi295uNPlKeOqA",
            "identity": {
                "userName": "999",
                "deviceName": "BackOffice",
                "envName": "BackOffice",
                "authenticationType": "Bearer"
            },
            "startedAt": "2023-08-04T21:21:07.66Z",
            "expiresAt": "2023-08-05T09:21:07.66Z",
            "lastAccessAt": "2023-08-04T21:21:11.578Z",
            "_v": 4
        }
    ],
    "count": 2,
    "totalCount": 2
}

Get session

GET http://{server-address}/sessions/{id}

Result is of type Session.

Path Parameters

NameTypeDescription

id*

string

Unique session identifier.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "sessionId": "Hq6563mjODIOwNa87Cgi295uNPlKeOqA",
    "identity":
    {
        "userName": "999",
        "deviceName": "BackOffice",
        "envName": "BackOffice",
        "authenticationType": "Bearer"
    },
    "startedAt": "2023-08-04T21:21:07.66Z",
    "expiresAt": "2023-08-05T09:21:07.66Z",
    "lastAccessAt": "2023-08-04T21:21:11.578Z",
    "_v": 7
}

Delete session

DELETE http://{server-address}/sessions/{id}

Result is of type Session.

Required rights

No user rights are required to perform this method.

Path Parameters

NameTypeDescription

id*

string

Unique session identifier.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "sessionId": "Hq6563mjODIOwNa87Cgi295uNPlKeOqA",
    "identity":
    {
        "userName": "999",
        "deviceName": "BackOffice",
        "envName": "BackOffice",
        "authenticationType": "Bearer"
    },
    "startedAt": "2023-08-04T21:21:07.66Z",
    "expiresAt": "2023-08-05T09:21:07.66Z",
    "lastAccessAt": "2023-08-04T21:21:11.578Z",
    "_v": 7
}

Last updated