# searchContact2

Version: 4.3.0+

Description: searching for contacts on the server.

Search results are cached. The cache record lifetime is 5 minutes.

In response to this command, the cached result and the search result from the personal address book will be returned. If there is no result in the cache for the current request, then a contact search will be performed on the server.

The search result from the server will arrive via a notification - contactsSearched.

Request example:

{
    "method" : "searchContact2",
    "requestId" : "1",
    "searchingString" : "us"
}

Response example:

{
    "method": "searchContact2",
    "requestId": "1",
    "foundContacts": [
        {
            "peerId": "user1@some.server",
            "displayName": "U1",
            "isInAbook" : true
        },
        {
            "peerId": "user2@some.server",
            "displayName": "U2",
            "isInAbook" : true
        },
        {
            "peerId": "user3@some.server",
            "displayName": "U3",
            "isInAbook" : true
        }
    ],
    "result": true
}

Parameter description:

  • searchingString - the string that will be used for the search

  • requestId - unique request identifier

  • foundContacts - list of found contacts

  • peerId - unique identifier of the found contact

  • displayName - the display name of the found contact

  • isInAbook - a flag indicating the presence of a contact in the address book

See also: