# searchContact

Version: 4.2.0

Description: searching for contacts on the server.

Search results are cached. The cache entry has a lifespan of 5 minutes. There is also a limitation on the frequency of requests. One search request is available every 2 seconds. If a request with a new search string is made during this timeout period, an error will be returned; if the request is made with a string that has already been searched for, the cached result will be provided.

Request example:

{
    "method" : "searchContact",
    "searchingString" : "us",
    "searchingMask" : 3,
    "searchingTimeoutMsec" : 2000
}

Response example:

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

Parameter description:

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

  • searchingTimeoutMsec - timeout for search and response delivery, specified in milliseconds. Available value range is 1..20000.

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

  • searchingMask - an optional parameter representing the search locations. Available locations:

    • 1 - search by user's unique identifier

    • 2 - search by the user's display name or by additional user fields - first and last name

  • requestId - unique request identifier

  • foundContacts - list of found contacts

  • peerId - unique identifier of the found contact

  • displayName - the display name of the found contact

See also: