A working example which guides you through the API basics. It prints a list of all available domains.
Login includes entering server hostname and login credentials with administration rights.
It is also possible to use the read-only rights but please keep in mind that you cannot change any settings then.
Each request must contain valid Cookies with the X-Token value you obtained from login response.
To send a request, just send the JSON to server's API endpoint.
HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json-rpc; charset=utf-8
Date: Thu, 28 Aug 2014 06:46:35 GMT
Server: Kerio Connect 8.3.1
X-Frame-Options: SAMEORIGIN
X-UA-Compatible: IE=edge
{"jsonrpc":"2.0","id":3,"result":{"list":[{"id":"keriodb://domain/2cf3ef60-c3c3-492b-ab57-a9a8774bd7fc","name":"demo.kerio.com","description":"","isPrimary":true,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":true,"days":30},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"DEMO.local","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/5bbfeb95-e192-4fbb-84da-e4cbcde54ac8","name":"123.com","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/c21d1204-f65e-4628-8459-44668764ccc4","name":"abc.co.uk","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/4a4b2cd5-8b11-4bd6-8664-d0d659d28382","name":"dokimi.gr","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/2c23dc19-43a2-465f-86b5-8816bf53bbd4","name":"example.com","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/46a6c031-1cc3-4f9e-9734-25ab9d22e8e3","name":"hello.uz","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/a53c0d7e-427f-4a7b-a63f-3d947fc89454","name":"ivan.com","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/44ecc1fb-fba3-4a75-b4b9-9f2528e50995","name":"kidat.de","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/ef0698e4-8661-47e0-83df-73f729e4beab","name":"mm","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/2557ab49-819e-4227-a212-6ddb524f146f","name":"mykerio.co.uk","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/1935afd9-bdf1-4820-8135-a098c7d323e6","name":"prueba.es","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/d85f3510-7809-47d6-9ec3-94e8767756a4","name":"sadss","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/ba9c64c9-96c7-4c9b-8005-d731688ef1cc","name":"sdsd","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/75fcc0b7-fc1d-434c-a1a4-e1ab2385a5b9","name":"test","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/5a99acb8-bcf2-49b1-9255-502ed8691937","name":"test1","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/52c5bef2-7595-484c-8c3c-183b9a533c8c","name":"testtset.com","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/011e9e1a-bc49-4625-895d-d7726bdb292a","name":"tetu","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/4d68d9e6-db5c-47db-8bfc-6e6b0117253b","name":"trydemo","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/22a7aa5c-eab7-491f-a9a5-bbb603744eee","name":"udoniko","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/5a38e5c0-746d-4b95-a371-c11c54754d55","name":"xxxbertxxx","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false},{"id":"keriodb://domain/5c72404d-1cc3-47ac-8833-33fbed1edad7","name":"zxczxccz","description":"","isPrimary":false,"userMaxCount":0,"outgoingMessageLimit":{"isActive":false,"limit":{"value":0,"units":"Bytes"}},"keepForRecovery":{"isEnabled":false,"days":0},"aliasList":[],"forwardingOptions":{"isEnabled":false,"host":"","port":0,"how":"Online","preventLoop":false},"kerberosRealm":"","winNtName":"","pamRealm":"","ipAddressBind":{"enabled":false,"value":"0.0.0.0"},"renameInfo":{"isRenamed":false,"oldName":"","newName":""},"isDistributed":false}],"totalItems":21}}
At the end, it is a good practice to logout and close connection to the server. You are done.