π SessionsThis 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
200: OK Successful response
Copy {
"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
200: OK Resource found. 404: Not Found Given resource was not found.
Copy {
"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
}
Copy {
"title" : "Zdroj nebol nΓ‘jdenΓ½" ,
"status" : 404
}
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
204: No Content Successfully deleted. 404: Not Found Given resource was not found.
Copy {
"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
}
Copy {
"title" : "Zdroj nebol nΓ‘jdenΓ½" ,
"status" : 404
}