Skip to content

Get All Users

Returns an array of all available users. Private fields (a password, for example) aren't included in the response.

Request

HTTP Request

GET /node/api/users

Path parameters

No parameters required.

Request body

The request body is empty.

Response

Field Type Description
users Array<User> An array of users.

Examples

Request examples

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

curl -X GET $url -u $login:$password
let login = <...>
let password = <...>
let saymonHostname = <...>
let path = "/node/api/users";
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 path = "/node/api/users";
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 = <your_login>
password = <your_password>
saymon_hostname = <your_saymon_hostname>
url = "https://" + saymon_hostname + "/node/api/users"

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

Response example

[
    {
        "id": "5e21b752308c3c66d64e072c",
        "login": "admin",
        "group": null,
        "authenticationToken": null,
        "status": 2,
        "eventFilter": [],
        "permissions": [
            "manage-objects",
        ],
        "contacts": []
    },
    {
        "id": "5e4fc1c77915112ac209e53d",
        "login": "John",
        "uiSettings": {
            "muteSystemSounds": false
        },
        "status": 2,
        "eventFilter": [],
        "objectPermissions": {
            "include": [
                1
            ],
            "exclude": [
                "5e21b85b308c3c66d64e07bc"
            ]
        },
        "permissions": [],
        "contacts": []
    },
    {
        "id": "5e78c51788c61a1fbf34b673",
        "login": "Bob",
        "status": 2,
        "eventFilter": [],
        "permissions": [
            "manage-links"
        ],
        "contacts": []
    }
]