An unofficial API wrapper for Kerio Connect Mail Server jsonrpc Admin API.
.deb file install) version 10.0.8 Patch 2. You can download it here: http://download.kerio.com/archive/
SESSION_CONNECT_WEBADMIN and an X-Token Header for CSRF protection, and a json body
/admin/api/jsonrpc
node /opt/kerio/app.js will have a json log file at /opt/kerio/log/kerio.log Generated by the pino package. With also pino-pretty printed to stdout
bash
npm install @brickert/kerio-connect-api
`
Usage
A typical quick one-off script can be such as:
`javascript
import { Kerio } from "@brickert/kerio-connect-api";
var kerio = new Kerio({
hostname: "192.168.1.1",
port: 4040,
endpoint_url: '/admin/api/jsonrpc',
https: true
}, {
name: "kerio-connect-api",
vendor: "Example Inc",
version: "1.0"
}, {
logLevel: 'info'
});
try {
await kerio.login({
username: "operator",
password: "foobar"
});
let add_host_id = await kerio.IPAddressGroups.addHostToIPAddressGroup("192.168.1.2", "Example Client Name", "My Group Name", true);
console.log(add_host_id);
// keriodb://ipaddressgroup/1234-5678-901-2345
} catch (e) {
console.log(e);
}
``