Get Users' Sessions Log

Get node/api/users/session/log

Returns the array of records of users' sessions.
Permissions: read-session-log.

Request parameters

Query parameters

Parameter
Type
Description
from
integer optional
A lower bound timestamp for session records.
limit
integer optional
The maximum number of retrieved records.
skip
integer optional
The number of records to be skipped, starting with the last record.
to
integer optional
An upper bound timestamp for the session records.

Response description

Field
Type
Description
endTime
integer
The timestamp for the end of the session.
expiredAt
integer
The timestamp for the expected end of the session due to user's inactivity.
id
string
Record's ID.
login
string
User's login.
startTime
integer
The timestamp for the beginning of the session.
userId
string
User's ID.

Examples

Request examples

Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
url=http://$saymon_hostname/node/api/users/session/log
5
6
curl -X GET $url -u $login:$password
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let path = "/node/api/users/session/log";
5
let auth = "Basic " + btoa(login + ":" + password);
6
7
let headers = new Headers();
8
headers.append("Authorization", auth);
9
10
let requestOptions = {
11
method: "GET",
12
headers: headers
13
};
14
15
fetch(saymonHostname + path, requestOptions)
16
.then(response => response.text())
17
.then(result => console.log(result))
18
.catch(error => console.log("error", error));
Copied!
1
let http = require('follow-redirects').http;
2
let fs = require('fs');
3
4
let login = <...>
5
let password = <...>
6
let saymonHostname = <...>
7
let path = '/node/api/users/session/log';
8
let auth = 'Basic ' + Buffer.from(login + ':' + password).toString('base64');
9
10
let options = {
11
'method': 'GET',
12
'hostname': saymonHostname,
13
'path': path,
14
'headers': {
15
'Authorization': auth
16
},
17
'maxRedirects': 20
18
};
19
20
let req = http.request(options, function (res) {
21
let chunks = [];
22
23
res.on("data", function (chunk) {
24
chunks.push(chunk);
25
});
26
27
res.on("end", function (chunk) {
28
let body = Buffer.concat(chunks);
29
console.log(body.toString());
30
});
31
32
res.on("error", function (error) {
33
console.error(error);
34
});
35
});
36
37
req.end();
Copied!
1
import requests
2
3
login = <...>
4
password = <...>
5
saymon_hostname = <...>
6
url = "http://" + saymon_hostname + "/node/api/users/session/log"
7
8
response = requests.request("GET", url, auth=(login, password))
9
print(response.text)
Copied!

Response example

1
[
2
{
3
"startTime": 1651662280161,
4
"endTime": null,
5
"expiredAt": 1651671819978,
6
"userId": "5f5f420005a91e683e101ca7",
7
"login": "admin",
8
"id": "62725dc8bad91064e16e5910"
9
}
10
]
Copied!