Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » Web API (Web API)
  •  
hotadd

Messages: 2
Karma: 0
Send a private message to this user
Sorry, i new in kerio product.
I have kerio connect in linux server, and i need synchronization contact with external web aplication.

where i can found documentation about API in kerio connect?
Can i use API for:
1) Remote add contact to Kerio Connect
2) After add contact to Kerio add it to external application (for this need Web Hook and fire action after add contact to Kerio)

[Updated on: Wed, 10 August 2011 09:15]

  •  
Kedar

Messages: 1320
Karma: 48
Send a private message to this user
API is now available for administration - http://www.kerio.com/betas/connect/administration-api
We do not have a time frame on if or when this feature may be available.
  •  
hotadd

Messages: 2
Karma: 0
Send a private message to this user
Hi. I registered on this programm. But i don't find any api for this purposes.
Main Api function for administration.
1) How i can get public contacts(not user) from kerio connect with api?
2) How i can add public contact(not user) to kerio connect with api?

Could you help?
  •  
jannemec

Messages: 6
Karma: 0
Send a private message to this user
Same problem - it would be nice via api - webMail component - get access to read contact in public folders. I can use Contacts.get but it returns only users with name and email - no phones, addresses, companyname, ...
  •  
Miroslav Osladil (Kerio)

Messages: 188

Karma: 27
Send a private message to this user
jannemec wrote on Fri, 30 November 2012 08:08
Same problem - it would be nice via api - webMail component - get access to read contact in public folders. I can use Contacts.get but it returns only users with name and email - no phones, addresses, companyname, ...


Hello Jan,

Please, can you share your request and the response you have got? My response of Contacts.get looks as follows.

Sample request:
{
  "jsonrpc":"2.0",
  "id":1,
  "method":"Contacts.get",
  "params":{
    "folderIds":[],
    "query":{
      "start":0,
      "limit":500
    }
  }
}


Sample response:
{
  "jsonrpc":"2.0",
  "id":1,
  "result":{
    "list":[
      {
        "id":"keriostorage://contact/5272 ... 8db/399",
        "folderId":"keriostorage://folder/5272 ... d8db",
        "watermark":0,
        "type":"ctContact",
        "commonName":"Miroslav Osladil",
        "firstName":"Miroslav",
        "middleName":"",
        "surName":"Osladil",
        "titleBefore":"",
        "titleAfter":"",
        "nickName":"",
        "phoneNumbers":[
          {
            "type":"TypeWorkVoice",
            "number":"128"
          }
        ],
        "emailAddresses":[
          {
            "address":"mosladil<_at_>kerio.com",
            "name":"",
            "preferred":true,
            "type":"EmailWork",
            "refId":""
          }
        ],
        "homeAddress":{
          "preferred":false,
          "pobox":"",
          "street":"",
          "state":"",
          "locality":"",
          "zip":"",
          "country":"",
          "label":""
        },
        "workAddress":{
          "preferred":false,
          "pobox":"",
          "street":"Anglické nábřeží 1/2434",
          "state":"",
          "locality":"Plzen",
          "zip":"301 00",
          "country":"Czech Republic",
          "label":""
        },
        "otherAddress":{
          "preferred":false,
          "pobox":"",
          "street":"",
          "state":"",
          "locality":"",
          "zip":"",
          "country":"",
          "label":""
        },
        "homeUrl":"",
        "workUrl":"",
        "otherUrl":"",
        "birthDay":"",
        "anniversary":"",
        "companyName":"Kerio Technologies s.r.o.",
        "departmentName":"QA",
        "officeNumber":"",
        "profession":"Developer",
        "managerName":"",
        "assistantName":"",
        "comment":"",
        "IMAddress":"",
        "photo":{
          "id":"cid:VCardPhoto--1675691096--1298518016@gal",
          "url":"/webmail/api/download/vcard-photo/5272 ... 8db/399/?version=0"
        },
        "categories":[
          "Global Address List"
        ],
        "isGalContact":true,
        "searchList":[
          "Miroslav  Osladil",
          "Kerio Technologies s.r.o.",
          "Developer"
        ]
      }
    ],
    "totalItems":1
  }
}


Please note that this API is currently under development nor intended for stable use yet.
Functionality might not be fully verified, documented, or even supported.

M.

Miroslav Osladil
Senior Developer
Kerio Technologies

The views I express are my own and do not necessarily reflect the views of Kerio Technologies.
  •  
jannemec

Messages: 6
Karma: 0
Send a private message to this user
Good morning, for the same request
{
"jsonrpc":"2.0"
,"id":2
,"token":"0ecd0adf35f736a4b0b6b28f299c2839d46f18e72026ec5c9368bdcad7a8e77e"
,"method":"Contacts.get"
,"params":{
 "folderIds":[]
 ,"query":{"start":0,"limit":500}
 }
}

I've got the response without details ...
{"jsonrpc":"2.0"
,"id":2
,"result":
{"list":[{
"type":"ctContact"
,"commonName":"Mgr. Jan Němec"
,"firstName":"Jan"
,"middleName":""
,"surName":"Němec"
,"titleBefore":"Mgr."
,"titleAfter":""
,"nickName":""
,"phoneNumbers":[]
,"emailAddresses":[{"address":"nemec@silon.eu","name":"Němec Jan (nemec<_at_>silon.eu)","type":"EmailWork","preferred":true}]
,"homeAddress":{"preferred":false
,"pobox":""
,"street":""
,"state":""
,"locality":""
,"zip":""
,"country":""
,"label":""}
,"workAddress":{"preferred":false
,"pobox":""
,"street":""
,"state":""
,"locality":""
,"zip":""
,"country":""
,"label":""}
,"otherAddress":{"preferred":false
,"pobox":""
,"street":""
,"state":""
,"locality":""
,"zip":""
,"country":""
,"label":""}
,"homeUrl":""
,"workUrl":""
,"otherUrl":""
,"birthDay":""
,"anniversary":""
,"companyName":""
,"departmentName":""
,"officeNumber":""
,"profession":""
,"managerName":""
,"assistantName":""
,"comment":""
,"IMAddress":""
,"categories":[]
,"isGalContact":false} ....


No phone, no depratment - in contacts "Server public contacts in outlook is at least phone, mobile and function ..."

JN
  •  
Miroslav Osladil (Kerio)

Messages: 188

Karma: 27
Send a private message to this user
jannemec wrote on Wed, 05 December 2012 07:28
No phone, no depratment - in contacts "Server public contacts in outlook is at least phone, mobile and function ..."


Please,
What version of Kerio Connect do you have? I tried it with latest Kerio Connect 8.0.0.
Do you see all the information (address, phones, ...) in WebMail?
Can you PM me this contact in VCARD file so I can test it?

Thanks, M.

Miroslav Osladil
Senior Developer
Kerio Technologies

The views I express are my own and do not necessarily reflect the views of Kerio Technologies.
  •  
jannemec

Messages: 6
Karma: 0
Send a private message to this user
Thanks for your aid, and
1) Yes, in webmail ("Veřejné složky" => "Kontakty") I see phones
2) Version of connect is 7.4.3 build 7813
3) files are attached - file from server and vcf file resend from webmail.

JN

  •  
Miroslav Osladil (Kerio)

Messages: 188

Karma: 27
Send a private message to this user
The reason is that even though Kerio Connect 7.4.3 contains some basic support of JSON-RPC API (now used by the new Kerio Connect client) this part of API is currently under development, not intended for 3rd-party use. It works somehow, it returns something, but very very limited.

If possible, please upgrade to latest version of Kerio Connect 8.0.0. I can see your phones with no problem in this version.

Still applies, functionality might not be fully verified, documented, or even supported.

You can play with it but keep in mind that we cannot guarantee, there won't be any change in next release.

Thanks for understanding. Smile

Cheers, M.

Miroslav Osladil
Senior Developer
Kerio Technologies

The views I express are my own and do not necessarily reflect the views of Kerio Technologies.
  •  
jannemec

Messages: 6
Karma: 0
Send a private message to this user
Thanks for reply - we plan upgrade in near future - hope will help.
JN
  •  
RuDy_

Messages: 2
Karma: 0
Send a private message to this user
Hi,

I'm trying to get all contacts from public list (GAL) to view it in our Web App. Using PHP API and code shown here I wrote:

  //PHP
    $method = 'Contacts.get';
    $params = array(
     		'folderIds' => array(),
     		'query' => array(
     				'start' => 0,
     				'limit' => 50
     				)     		
    );
     $result = $api->sendRequest($method, $params);


Request from DEBUG MODE :

→ Raw request:

POST /admin/api/jsonrpc/ HTTP/1.1
Accept: application/json-rpc
Content-Type: application/json-rpc; charset=UTF-8
User-Agent: Kerio APIs Client Library for PHP/1.3.0.62
Host: myserver:4040
Content-Length: 182
Connection: close
Cookie:  SESSION_CONNECT_WEBADMIN=d5d65b11d6df8632d8e191ee7da0f7f7afad491b23b3e7008d9e9ad9665d9372;
X-Token: d6c3a1c728f7058b976096cae2f38f08c2e2c387be320c7cd127637d6dceefd1

{"jsonrpc":"2.0","id":4,"token":"d6c3a1c728f7058b976096cae2f38f08c2e2c387be320c7cd127637d6dceefd1","method":"Contacts.get","params":{"folderIds":[],"query":{"start":0,"limit":50}}}




But there is no method:

HTTP/1.1 200 OK
Connection: Close
Content-Type: application/json-rpc; charset=utf-8
Date: Fri, 21 Jun 2013 09:48:37 GMT
Server: Kerio Connect 8.1.1
X-UA-Compatible: IE=edge

{"jsonrpc":"2.0","id":4,"error":{"code":-32601,"message":"Method not found.","data":{"messageParameters":{"positionalParameters":[],"plurality":1}}}}

Method not found.


What went wrong?

Is there any other way to get all contacts?
  •  
Miroslav Osladil (Kerio)

Messages: 188

Karma: 27
Send a private message to this user
According the debug I see you're connecting to port 4040 which Administration API is listening on. Try to use
$api->setComponentClient();

before login to use proper API component.

Best regards,

Miroslav Osladil
Senior Developer
Kerio Technologies

The views I express are my own and do not necessarily reflect the views of Kerio Technologies.
  •  
RuDy_

Messages: 2
Karma: 0
Send a private message to this user
Yep!
$api->setComponentClient();

is solution!
Thx!

Any good documentation from can I get so knowledge?

If someone need get all contacts using PHP API:

<?php

require_once(dirname(__FILE__) . '/src/KerioConnectApi.php');
$api = new KerioConnectApi('Kerio Contacts', 'Company', '1.0');

//$api->setDebug(TRUE);
$api->setComponentClient();

$hostname = 'mail.domain.com';
$username = 'user';
$password = 'pass';

/* Main application */
try {
    
    /* Login */
    $session = $api->login($hostname, $username, $password);
   
    /* Get all contacts */
    $method = "Contacts.get";
    $params = array(
     		'folderIds' => array(),
     		'query' => array(
     				'start' => 0,
     				'limit' => 500
     				)     		
    );
     $result = $api->sendRequest($method, $params);
   print_r(  $result['list']);
    
} catch (KerioApiException $error) {
    
    /* Catch possible errors */
    print $error->getMessage();
}

/* Logout */
if (isset($session)) {
    $api->logout(); 
}

?>
  •  
Miroslav Osladil (Kerio)

Messages: 188

Karma: 27
Send a private message to this user
Hi Marcin,

as I wrote in previous comment.

This part of API (Kerio Connect client) is currently under development, not intended for 3rd-party use.

Therefore, functionality might not be fully verified, documented, or even supported. We call it API in progress which means you can use it but keep in mind that we cannot guarantee, there won't be any change in next release.

As there is yet no official document describing this part of API or changes between version, the best way how to get some information is to ask here on forum. We always try to find solution, help or at least some advice...

Thanks for understanding.

Miroslav Osladil
Senior Developer
Kerio Technologies

The views I express are my own and do not necessarily reflect the views of Kerio Technologies.
Previous Topic: When user quota is exceeded, how long are messages queued?
Next Topic: XMPP Chat Room
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Thu Aug 24 10:36:16 CEST 2017

Total time taken to generate the page: 0.00574 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.