Skip to content

Get Password Log

Returns password change log.

Request

HTTP Request

GET /node/api/users/password/log

Permissions

manage-users

Query parameters

Parameter Type Description
userId String ID of a user whose password log should be retrieved.
from Integer
optional
A lower-bound timestamp for log records.
limit Integer
optional
The maximum number of records to be retrieved.
skip Integer
optional
The number of the first records to be skipped.
to Integer
optional
An upper-bound timestamp for log records.

Body parameters

The request body is empty.

Response

Response contains an array of password log entries. See the Password Log model for more information.

Examples

TODO: Verify Example

Request

login=<...>
password=<...>
saymon_hostname=<...>
userId=<...>
url=https://$saymon_hostname/node/api/users/password/log

curl -X GET $url -u $login:$password \
    -G --data-urlencode "userId=$userId"
let login = <...>
let password = <...>
let saymonHostname = <...>
let userId = <...>
let queryParams = "userId=" + userId;
let path = "/node/api/users/password/log" + "?" + queryParams;
let auth = "Basic " + btoa(login + ":" + password);

let headers = new Headers();
headers.append("Authorization", auth);

let requestOptions = {
    method: "GET",
    headers: headers
};

fetch(saymonHostname + path, requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log("error", error));
const http = require("http");

let login = <...>
let password = <...>
let saymonHostname = <...>
let userId = <...>
let queryParams = "userId=" + userId;
let path = "/node/api/users/password/log" + "?" + queryParams;
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");

let options = {
    "method": "GET",
    "hostname": saymonHostname,
    "headers": {
        "Authorization": auth
    },
    "path": path
};

let req = http.request(options, function (res) {
    let chunks = [];

    res.on("data", function (chunk) {
        chunks.push(chunk);
    });

    res.on("end", function (chunk) {
        let body = Buffer.concat(chunks);
        console.log(body.toString());
    });

    res.on("error", function (error) {
        console.error(error);
    });
});

req.end();
import requests

login = <...>
password = <...>
saymon_hostname = <...>
user_id = <...>
url = "https://" + saymon_hostname + "/node/api/users/password/log"

params = {
    "userId": user_id
}

response = requests.request("GET", url, auth=(login, password), params=params)
print(response.text)

Response

[
  {
    "timestamp": 1582799547000,
    "userId": "62fa271e18baa649c1d26338",
    "login": "user.name",
    "initiator": ""     // User changed password themselves
  },
  {
    "timestamp": 1582799547000,
    "userId": "62fa271e18baa649c1d26338",
    "login": "user.name",
    "initiator": "5e21b752308c3c66d64e072c"   // User's password was changed by another user 
  },
  ...
]

See Also